Skip to content

Commit

Permalink
Output the current environment in debug output when shelling out
Browse files Browse the repository at this point in the history
  • Loading branch information
sethvargo committed May 17, 2014
1 parent d5fbcdd commit d7b6292
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ Unreleased
- Fix a bug in `windows_safe_path` to always return a string
- Add a `Config.base_dir` configuration value for easy tuning
- Remove the use of `Omnibus.root` in `BuildVersion#initializer`. This removes the many deprecation warnings that print on each software load.
- Output the current command in debug output
- Output the current command in debug output when shelling out
- Output the current environment in debug output when shelling out


v3.1.0 (May 14, 2014)
Expand Down
12 changes: 11 additions & 1 deletion lib/omnibus/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,20 @@ module Util
#
def shellout(*args)
options = args.last.kind_of?(Hash) ? args.pop : {}
options = SHELLOUT_OPTIONS.merge(options)

# Log any environment options given
unless options[:environment].empty?
Omnibus.logger.debug { 'Environment:' }
options[:environment].each do |key, value|
Omnibus.logger.debug { " #{key.to_s.upcase}=#{value.inspect}" }
end
end

# Log the actual command
Omnibus.logger.debug { "$ #{args.join(' ')}" }

cmd = Mixlib::ShellOut.new(*args, SHELLOUT_OPTIONS.merge(options))
cmd = Mixlib::ShellOut.new(*args, options)
cmd.run_command
cmd
end
Expand Down

0 comments on commit d7b6292

Please sign in to comment.