From a1ba4e5362be1807fa21284ca66fa73eb6384235 Mon Sep 17 00:00:00 2001 From: Dave Sanderson Date: Tue, 12 Dec 2017 15:32:40 -0700 Subject: [PATCH] Silently continue on removeDir for Windows Fixed parameter type exclusion in movePath command --- provisioner/guest_commands.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/provisioner/guest_commands.go b/provisioner/guest_commands.go index 441154a50..1d2d1597f 100644 --- a/provisioner/guest_commands.go +++ b/provisioner/guest_commands.go @@ -14,7 +14,7 @@ type guestOSTypeCommand struct { mkdir string removeDir string statPath string - mv string + mv string } var guestOSTypeCommands = map[string]guestOSTypeCommand{ @@ -23,14 +23,14 @@ var guestOSTypeCommands = map[string]guestOSTypeCommand{ mkdir: "mkdir -p '%s'", removeDir: "rm -rf '%s'", statPath: "stat '%s'", - mv: "mv '%s' '%s'", + mv: "mv '%s' '%s'", }, WindowsOSType: { chmod: "echo 'skipping chmod %s %s'", // no-op mkdir: "powershell.exe -Command \"New-Item -ItemType directory -Force -ErrorAction SilentlyContinue -Path %s\"", - removeDir: "powershell.exe -Command \"rm %s -recurse -force\"", + removeDir: "powershell.exe -Command \"rm %s -recurse -force -ErrorAction SilentlyContinue\"", statPath: "powershell.exe -Command \"test-path %s\"", - mv: "powershell.exe -Command \"mv %s %s\"", + mv: "powershell.exe -Command \"mv %s %s\"", }, } @@ -74,7 +74,7 @@ func (g *GuestCommands) StatPath(path string) string { return g.sudo(fmt.Sprintf(g.commands().statPath, g.escapePath(path))) } -func (g *GuestCommands) MovePath(srcPath string, dstPath) string { +func (g *GuestCommands) MovePath(srcPath string, dstPath string) string { return g.sudo(fmt.Sprintf(g.commands().mv, g.escapePath(srcPath), g.escapePath(dstPath))) }