mirror of
https://github.com/gojp/goreportcard.git
synced 2026-01-28 22:39:05 +08:00
Closes #151. Use RemoveAll instead of Remove
This commit is contained in:
@@ -49,7 +49,10 @@ func download(path, dest string, firstAttempt bool) (root *vcs.RepoRoot, err err
|
||||
if err != nil && firstAttempt {
|
||||
// may have been rebased; we delete the directory, then try one more time:
|
||||
log.Printf("Failed to download %q (%v), trying again...", root.Repo, err.Error())
|
||||
err = os.Remove(fullLocalPath)
|
||||
err = os.RemoveAll(fullLocalPath)
|
||||
if err != nil {
|
||||
log.Println("Failed to delete path:", fullLocalPath, err)
|
||||
}
|
||||
return download(path, dest, false)
|
||||
} else if err != nil {
|
||||
return root, err
|
||||
@@ -66,7 +69,7 @@ func download(path, dest string, firstAttempt bool) (root *vcs.RepoRoot, err err
|
||||
if err != nil && firstAttempt {
|
||||
// may have been rebased; we delete the directory, then try one more time:
|
||||
log.Printf("Failed to update %q (%v), trying again...", root.Repo, err.Error())
|
||||
err = os.Remove(fullLocalPath)
|
||||
err = os.RemoveAll(fullLocalPath)
|
||||
return download(path, dest, false)
|
||||
}
|
||||
return root, err
|
||||
|
||||
Reference in New Issue
Block a user