lib/chef/knife/xargs_essentials.rb in knife-essentials-0.9.7 vs lib/chef/knife/xargs_essentials.rb in knife-essentials-0.9.8
- old
+ new
@@ -214,11 +214,11 @@
if config[:verbose_commands] || Chef::Config[:verbosity] && Chef::Config[:verbosity] >= 1
output sub_filenames(command, tempfiles)
end
command_output = `#{command}`
command_output = sub_filenames(command_output, tempfiles)
- output command_output
+ stdout.write command_output
# Check if the output is different
tempfiles.each_pair do |tempfile, file|
# Read the new output
new_value = IO.binread(tempfile.path)
@@ -241,11 +241,11 @@
old_file.close
diff = `diff -u #{old_file.path} #{tempfile.path}`
diff.gsub!(old_file.path, "#{format_path(file[:file])} (old)")
diff.gsub!(tempfile.path, "#{format_path(file[:file])} (new)")
- output diff
+ stdout.write diff
ensure
old_file.close!
end
end
end
@@ -253,10 +253,10 @@
error
end
def sub_filenames(str, tempfiles)
tempfiles.each_pair do |tempfile, file|
- str.gsub!(tempfile.path, format_path(file[:file]))
+ str = str.gsub(tempfile.path, format_path(file[:file]))
end
str
end
end