Class: Commands::Shell

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/shell.rb

Instance Method Summary collapse

Instance Method Details

#optionsObject

holds the options that were passed you can set any initial defaults here



13
14
15
16
# File 'lib/commands/shell.rb', line 13

def options
  @options ||= {
  }
end

#register(opts, global_options) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/commands/shell.rb', line 24

def register(opts, global_options)
  opts.banner = "Usage: shell"
  opts.description = "Test running of a shell script."
  opts.on('-b', "--branch config branch name", "Use build config branch") do |v|
    options[:branch] = v
  end
end

#required_optionsObject

required options



19
20
21
22
# File 'lib/commands/shell.rb', line 19

def required_options
  @required_options ||= Set.new [
  ]
end

#run(global_options) ⇒ Object



32
33
34
35
36
37
38
39
# File 'lib/commands/shell.rb', line 32

def run(global_options)
  config_branch = options[:branch]
  config_repo_url = EcbSharedLib.prepare_config_repo(config_branch)
  base = EcbSharedLib.full_config_path(config_repo_url)
  newpath = File.expand_path(File.join(base, "scripts"))
  cmd = "./ecb_test.sh"
  EcbSharedLib::CL.do_cmd(cmd, newpath)
end