|
@@ -225,11 +225,11 @@ func ArozZipFileWithProgress(targetFshs []*FileSystemHandler, filelist []string,
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
- file, err := fshAbs.ReadStream(path)
|
|
|
+ thisFile, err := fshAbs.ReadStream(path)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- defer file.Close()
|
|
|
+ defer thisFile.Close()
|
|
|
|
|
|
relativePath := strings.ReplaceAll(filepath.ToSlash(path), filepath.ToSlash(filepath.Clean(srcpath))+"/", "")
|
|
|
if includeTopLevelFolder {
|
|
@@ -243,7 +243,7 @@ func ArozZipFileWithProgress(targetFshs []*FileSystemHandler, filelist []string,
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- _, err = io.Copy(f, file)
|
|
|
+ _, err = io.Copy(f, thisFile)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -260,11 +260,11 @@ func ArozZipFileWithProgress(targetFshs []*FileSystemHandler, filelist []string,
|
|
|
} else {
|
|
|
//This is a file
|
|
|
topLevelFolderName := filepath.Base(filepath.Dir(srcpath))
|
|
|
- file, err := fshAbs.ReadStream(srcpath)
|
|
|
+ thisFile, err := fshAbs.ReadStream(srcpath)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- defer file.Close()
|
|
|
+ defer thisFile.Close()
|
|
|
relativePath := filepath.Base(srcpath)
|
|
|
if includeTopLevelFolder {
|
|
|
relativePath = topLevelFolderName + "/" + relativePath
|
|
@@ -275,7 +275,7 @@ func ArozZipFileWithProgress(targetFshs []*FileSystemHandler, filelist []string,
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- _, err = io.Copy(f, file)
|
|
|
+ _, err = io.Copy(f, thisFile)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -334,11 +334,11 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
//This is hidden file / folder. Skip this
|
|
|
return nil
|
|
|
}
|
|
|
- file, err := os.Open(path)
|
|
|
+ thisFile, err := os.Open(path)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- defer file.Close()
|
|
|
+ defer thisFile.Close()
|
|
|
|
|
|
relativePath := strings.ReplaceAll(filepath.ToSlash(path), filepath.ToSlash(filepath.Clean(srcpath))+"/", "")
|
|
|
if includeTopLevelFolder {
|
|
@@ -352,7 +352,7 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- _, err = io.Copy(f, file)
|
|
|
+ _, err = io.Copy(f, thisFile)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -366,11 +366,11 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
} else {
|
|
|
//This is a file
|
|
|
topLevelFolderName := filepath.Base(filepath.Dir(srcpath))
|
|
|
- file, err := os.Open(srcpath)
|
|
|
+ thisFile, err := os.Open(srcpath)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- defer file.Close()
|
|
|
+ defer thisFile.Close()
|
|
|
relativePath := filepath.Base(srcpath)
|
|
|
if includeTopLevelFolder {
|
|
|
relativePath = topLevelFolderName + "/" + relativePath
|
|
@@ -380,7 +380,7 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- _, err = io.Copy(f, file)
|
|
|
+ _, err = io.Copy(f, thisFile)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -406,12 +406,12 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
- file, err := fshAbs.ReadStream(path)
|
|
|
+ thisFile, err := fshAbs.ReadStream(path)
|
|
|
if err != nil {
|
|
|
fmt.Println(err)
|
|
|
return err
|
|
|
}
|
|
|
- defer file.Close()
|
|
|
+ defer thisFile.Close()
|
|
|
|
|
|
relativePath := strings.ReplaceAll(filepath.ToSlash(path), filepath.ToSlash(filepath.Clean(srcpath))+"/", "")
|
|
|
if includeTopLevelFolder {
|
|
@@ -425,7 +425,7 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- _, err = io.Copy(f, file)
|
|
|
+ _, err = io.Copy(f, thisFile)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
@@ -439,11 +439,11 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
} else {
|
|
|
//This is a file
|
|
|
topLevelFolderName := filepath.Base(filepath.Dir(srcpath))
|
|
|
- file, err := fshAbs.ReadStream(srcpath)
|
|
|
+ thisFile, err := fshAbs.ReadStream(srcpath)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|
|
|
- defer file.Close()
|
|
|
+ defer thisFile.Close()
|
|
|
relativePath := filepath.Base(srcpath)
|
|
|
if includeTopLevelFolder {
|
|
|
relativePath = topLevelFolderName + "/" + relativePath
|
|
@@ -453,7 +453,7 @@ func ArozZipFile(sourceFshs []*FileSystemHandler, filelist []string, outputFsh *
|
|
|
return err
|
|
|
}
|
|
|
|
|
|
- _, err = io.Copy(f, file)
|
|
|
+ _, err = io.Copy(f, thisFile)
|
|
|
if err != nil {
|
|
|
return err
|
|
|
}
|