Fixed relative path / bug

This commit is contained in:
Stefin 2022-07-07 18:56:37 +05:30
parent b50fe88474
commit d226ba536e
1 changed files with 3 additions and 0 deletions

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)