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

zip should accomodate relative links

This commit is contained in:
Zack Scholl 2018-09-21 22:06:00 -07:00
parent 9af7c05dc6
commit 6911848141

View file

@ -77,10 +77,13 @@ func UnzipFile(src, dest string) (err error) {
return
}
// ZipFile will zip the file
// ZipFile will zip the folder
func ZipFile(fname string, compress bool) (writtenFilename string, err error) {
logger.SetLogLevel(DebugLevel)
fname, err = filepath.Abs(fname)
if err != nil {
return
}
log.Debugf("zipping %s with compression? %v", fname, compress)
pathtofile, filename := filepath.Split(fname)
curdir, err := os.Getwd()