From a1db1d2e0afb63e342a9e9ef4d4fc6c35567dbe8 Mon Sep 17 00:00:00 2001 From: WillyDolly Date: Mon, 24 Sep 2018 21:24:41 +0700 Subject: [PATCH 1/2] Update winbug.go --- path/winbug.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/path/winbug.go b/path/winbug.go index ddb423b4..eb48817b 100644 --- a/path/winbug.go +++ b/path/winbug.go @@ -44,12 +44,12 @@ func CustomRemoveAll(p string) error { // Handle the windows case first if runtime.GOOS == "windows" { msg.Debug("Detected Windows. Removing files using windows command") - cmd := exec.Command("cmd.exe", "/c", "rd", "/s", "/q", p) + cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\") output, err := cmd.CombinedOutput() if err != nil { exitCode := getExitCode(err) if exitCode != winErrorFileNotFound && exitCode != winErrorPathNotFound { - return fmt.Errorf("Error removing files: %s. output: %s", err, output) + return fmt.Errorf("Error removing MY files: %s. output: %s", err, output) } } return nil From e44651fe1e2a6f80b12bbef7c4f624ded5557bbc Mon Sep 17 00:00:00 2001 From: WillyDolly Date: Wed, 26 Sep 2018 15:46:57 +0700 Subject: [PATCH 2/2] Update winbug.go --- path/winbug.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/path/winbug.go b/path/winbug.go index eb48817b..353b7a28 100644 --- a/path/winbug.go +++ b/path/winbug.go @@ -72,10 +72,10 @@ func CustomRename(o, n string) error { // Handking windows cases first if runtime.GOOS == "windows" { msg.Debug("Detected Windows. Moving files using windows command") - cmd := exec.Command("cmd.exe", "/c", "move", o, n) + cmd := exec.Command("cmd.exe", "/c", "xcopy /s/y", o, n+"\\") output, err := cmd.CombinedOutput() if err != nil { - return fmt.Errorf("Error moving files: %s. output: %s", err, output) + return fmt.Errorf("Error moving MY files: %s. output: %s", err, output) } return nil