lib/bolt/shell/powershell.rb in bolt-2.15.0 vs lib/bolt/shell/powershell.rb in bolt-2.16.0
- old
+ new
@@ -109,10 +109,11 @@
end
Snippets.execute_process(exec_cmd)
end
def mkdirs(dirs)
- mkdir_command = "mkdir -Force #{dirs.uniq.sort.join(',')}"
+ paths = dirs.uniq.sort.join('","')
+ mkdir_command = "mkdir -Force -Path (\"#{paths}\")"
result = execute(mkdir_command)
if result.exit_code != 0
message = "Could not create directories: #{result.stderr.string}"
raise Bolt::Node::FileError.new(message, 'MKDIR_ERROR')
end