Remove file before extracting when using ziti use

This commit is contained in:
Paul Lorenz
2023-06-21 15:11:34 -04:00
parent fa297c7860
commit 263ff30ce6
+4
View File
@@ -377,6 +377,10 @@ func UnTargz(tarball, target string, onlyFiles []string) error {
return err
}
continue
} else {
if err = os.Remove(path); err != nil {
fmt.Printf("error removing [%s] (%v)", path, err)
}
}
file, err := os.OpenFile(path, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, info.Mode())