mirror of
https://github.com/schollz/croc.git
synced 2024-11-24 08:02:33 +03:00
use to/from slash
This commit is contained in:
parent
ffbc607303
commit
9e02fa746c
@ -30,6 +30,7 @@ func unzipFile(src, dest string) (err error) {
|
|||||||
// Store filename/path for returning and using later on
|
// Store filename/path for returning and using later on
|
||||||
fpath := filepath.Join(dest, f.Name)
|
fpath := filepath.Join(dest, f.Name)
|
||||||
log.Debugf("unzipping %s", fpath)
|
log.Debugf("unzipping %s", fpath)
|
||||||
|
fpath = filepath.FromSlash(fpath)
|
||||||
|
|
||||||
if f.FileInfo().IsDir() {
|
if f.FileInfo().IsDir() {
|
||||||
|
|
||||||
@ -145,6 +146,8 @@ func zipFile(fname string, compress bool) (writtenFilename string, err error) {
|
|||||||
header.Method = zip.Deflate
|
header.Method = zip.Deflate
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header.Name = filepath.ToSlash(header.Name)
|
||||||
|
|
||||||
writer, err = zipWriter.CreateHeader(header)
|
writer, err = zipWriter.CreateHeader(header)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user