Skip to content

Commit

Permalink
Fixed relative path / bug
Browse files Browse the repository at this point in the history
  • Loading branch information
stefins committed Jul 7, 2022
1 parent b50fe88 commit d226ba5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/croc/croc.go
Expand Up @@ -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)
Expand Down

0 comments on commit d226ba5

Please sign in to comment.