summaryrefslogtreecommitdiff
path: root/lib/mixlib
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mixlib')
-rw-r--r--lib/mixlib/shellout/windows.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/mixlib/shellout/windows.rb b/lib/mixlib/shellout/windows.rb
index 27adbbd..a42a30e 100644
--- a/lib/mixlib/shellout/windows.rb
+++ b/lib/mixlib/shellout/windows.rb
@@ -66,7 +66,7 @@ module Mixlib
#
# Set cwd, environment, appname, etc.
#
- app_name, command_line = command_to_run(command)
+ app_name, command_line = command_to_run(combine_args(*command))
create_process_args = {
app_name: app_name,
command_line: command_line,
@@ -196,6 +196,17 @@ module Mixlib
true
end
+ def combine_args(*args)
+ return args if args.length == 1
+ args.map do |arg|
+ if arg.match(/[ \t\n\v"]/)
+ "\"#{arg}\""
+ else
+ arg
+ end
+ end.join(" ")
+ end
+
def command_to_run(command)
return run_under_cmd(command) if should_run_under_cmd?(command)