Skip to content

Commit

Permalink
Here is the English translation:
Browse files Browse the repository at this point in the history
If there are directories in a zip file compressed on the Windows platform, the "\\" in the filepath will cause the files to be extracted normally on Linux, and ls will show filenames containing single quotes.

So when compressing, I replace "\\" with "/" so that it seems there are no issues on both Windows and Linux.
  • Loading branch information
zx9597446 committed Aug 17, 2023
1 parent ef68dfa commit d724f11
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d724f11

Please sign in to comment.