mirror of
https://github.com/filebrowser/filebrowser.git
synced 2024-06-07 23:00:43 +00:00
fix: empty folder in archive
This commit is contained in:
parent
36cacdf598
commit
7096b3dab9
@ -116,6 +116,7 @@ func addFile(ar archiver.Writer, d *data, path, commonPath string) error {
|
|||||||
}
|
}
|
||||||
defer file.Close()
|
defer file.Close()
|
||||||
|
|
||||||
|
if path != commonPath {
|
||||||
filename := strings.TrimPrefix(path, commonPath)
|
filename := strings.TrimPrefix(path, commonPath)
|
||||||
filename = strings.TrimPrefix(filename, "/")
|
filename = strings.TrimPrefix(filename, "/")
|
||||||
err = ar.Write(archiver.File{
|
err = ar.Write(archiver.File{
|
||||||
@ -128,6 +129,7 @@ func addFile(ar archiver.Writer, d *data, path, commonPath string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if info.IsDir() {
|
if info.IsDir() {
|
||||||
names, err := file.Readdirnames(0)
|
names, err := file.Readdirnames(0)
|
||||||
|
Loading…
Reference in New Issue
Block a user