1
1
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

Fixed relative path / bug

This commit is contained in:
Stefin 2022-07-07 18:56:37 +05:30
parent b50fe88474
commit d226ba536e

View file

@ -286,6 +286,9 @@ func GetFilesInfo(fnames []string, zipfolder bool) (filesInfo []FileInfo, emptyF
}
if stat.IsDir() && zipfolder {
if path[len(path)-1:] != "/" {
path += "/"
}
path := filepath.Dir(path)
dest := filepath.Base(path) + ".zip"
utils.ZipDirectory(dest, path)