Skip to content

Commit

Permalink
Merge pull request #268 from james-stocks/log_gem_env
Browse files Browse the repository at this point in the history
(maint) Debug output GEM_HOME and GEM_PATH before executing module commands
  • Loading branch information
DavidS authored Aug 25, 2017
2 parents d02f959 + 6e2cb5a commit bafb86f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/pdk/cli/exec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,10 @@ def run_process_in_clean_env!
def run_process!
command_string = argv.join(' ')
PDK.logger.debug(_("Executing '%{command}'") % { command: command_string })
if context == :module
PDK.logger.debug(_("Command environment: GEM_HOME is '%{gem_home}' and GEM_PATH is '%{gem_path}'") % { gem_home: @process.environment['GEM_HOME'],
gem_path: @process.environment['GEM_PATH'] })
end
start_time = Time.now
begin
@process.start
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/pdk/cli/exec/command_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
allow(PDK::Util).to receive(:module_root).with(no_args).and_return('/invalid_path')
allow(Dir).to receive(:chdir).with('/invalid_path').and_yield
allow(process).to receive(:exit_code).and_return 0
allow(process).to receive(:environment).and_return environment
allow(process).to receive(:environment).at_least(:once).and_return environment
end

it { expect { command.execute! }.not_to raise_error }
Expand Down

0 comments on commit bafb86f

Please sign in to comment.