Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update winbug.go #1022

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions path/winbug.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down