diff --git a/dup.rb b/dup.rb index ea4c548..70146b0 100755 --- a/dup.rb +++ b/dup.rb @@ -92,7 +92,7 @@ end def run(cmd, ignore_returnvalue=false) puts "+ #{cmd}" - returnvalue = $dry_run ? true : system(cmd) + returnvalue = $dry_run ? true : system("bash -c #{cmd.shellescape}") raise "Command returned a non-zero exit value." if returnvalue!=true && !ignore_returnvalue end @@ -147,7 +147,7 @@ def action_run(container, file) if data[yml_name].is_a?(Array) data[yml_name].each {|val| cmd << cmd_name << esc(val, options[:escape])} elsif data[yml_name].is_a?(Hash) - data[yml_name].each {|key, val| cmd << cmd_name << "#{esc(key, options[:escape])}=#{esc(val, options[:escape])}"} + data[yml_name].each {|key, val| cmd << cmd_name << "#{esc(key, options[:escape])}=\"#{esc(val, options[:escape])}\""} else cmd << cmd_name << esc(data[yml_name], options[:escape]) end