1
0
mirror of https://github.com/schollz/croc.git synced 2024-11-23 23:54:17 +03:00

Merge pull request #589 from zx9597446/main

zip file bug on windows and linux
This commit is contained in:
Zack 2023-08-18 11:00:46 +02:00 committed by GitHub
commit cff8cddd13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -402,6 +402,7 @@ func ZipDirectory(destination string, source string) (err error) {
}
defer f1.Close()
zipPath := strings.ReplaceAll(path, source, strings.TrimSuffix(destination, ".zip"))
zipPath = filepath.ToSlash(zipPath)
w1, err := writer.Create(zipPath)
if err != nil {
log.Fatalln(err)