fix: handle error on rename
This commit is contained in:
5
main.go
5
main.go
@ -114,7 +114,10 @@ func normalize(p string, f os.FileInfo, err error) error {
|
|||||||
if dryrun {
|
if dryrun {
|
||||||
fmt.Printf("Would move %s to %s\n", p, newPath)
|
fmt.Printf("Would move %s to %s\n", p, newPath)
|
||||||
} else {
|
} else {
|
||||||
os.Rename(p, newPath)
|
err = os.Rename(p, newPath)
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
fmt.Printf("%s => %s\n", p, newPath)
|
fmt.Printf("%s => %s\n", p, newPath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user