Class: ChefCLI::Command::Exec
Instance Method Summary collapse
Methods inherited from Base
#check_license_acceptance, #initialize, #run_with_default_options
Methods included from Helpers
#err, #fetch_chef_cli_version_pkg, #get_pkg_install_path, #get_pkg_prefix, #git_bin_dir, #git_windows_bin_dir, #habitat_chef_dke?, #habitat_env, #habitat_install?, #habitat_standalone?, #msg, #omnibus_bin_dir, #omnibus_embedded_bin_dir, #omnibus_env, #omnibus_expand_path, #omnibus_install?, #omnibus_root, #package_home, #stderr, #stdout, #system_command, #usr_bin_path, #usr_bin_prefix
Constructor Details
This class inherits a constructor from ChefCLI::Command::Base
Instance Method Details
#needs_help?(params) ⇒ Boolean
44 45 46 |
# File 'lib/chef-cli/command/exec.rb', line 44 def needs_help?(params) ["-h", "--help"].include? params[0] end |
#needs_version?(params) ⇒ Boolean
39 40 41 42 |
# File 'lib/chef-cli/command/exec.rb', line 39 def needs_version?(params) # Force version to get passed down to command false end |
#run(params) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'lib/chef-cli/command/exec.rb', line 30 def run(params) # Set ENV directly on the "parent" process (us) before running #exec to # ensure the custom PATH is honored when finding the command to exec env = habitat_install? ? habitat_env : omnibus_env env.each { |var, value| ENV[var] = value } exec(*params) raise "Exec failed without an exception, your ruby is buggy" # should never get here end |