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:
parent
9af7c05dc6
commit
6911848141
1 changed files with 5 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue