Skip to content

Commit 3ed3c63

Browse files
authored
copy-content: delete destination dirs before copying (#3197)
Signed-off-by: Joe Lanford <[email protected]>
1 parent 81eef3a commit 3ed3c63

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cmd/copy-content/main.go

+4
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ func main() {
3131
*catalogSource: *catalogDestination,
3232
*cacheSource: *cacheDestination,
3333
} {
34+
if err := os.RemoveAll(to); err != nil {
35+
fmt.Printf("failed to remove %s: %s", to, err)
36+
os.Exit(1)
37+
}
3438
if err := copy.Copy(from, to); err != nil {
3539
fmt.Printf("failed to copy %s to %s: %s\n", from, to, err)
3640
os.Exit(1)

0 commit comments

Comments
 (0)