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

need to watch slashes

This commit is contained in:
Zack Scholl 2018-10-24 06:48:05 -07:00
parent 0ca74b010e
commit e57f3e3861

View file

@ -139,6 +139,7 @@ func zipFiles(fnames []string, compress bool, zipWriter *zip.Writer) (err error)
log.Error(err)
return err
}
absPath = filepath.ToSlash(absPath)
// get path to file and the filename
fpath, fname := filepath.Split(absPath)
@ -185,7 +186,7 @@ func zipFiles(fnames []string, compress bool, zipWriter *zip.Writer) (err error)
if baseDir != "" {
header.Name = path.Join(fname, strings.TrimPrefix(curpath, baseDir))
}
header.Name = filepath.Clean(filepath.ToSlash(header.Name))
header.Name = filepath.ToSlash(filepath.Clean(header.Name))
log.Debug(header.Name)
if info.IsDir() {