fix: empty folder in archive
@@ -116,6 +116,7 @@ func addFile(ar archiver.Writer, d *data, path, commonPath string) error {
}
defer file.Close()
+ if path != commonPath {
filename := strings.TrimPrefix(path, commonPath)
filename = strings.TrimPrefix(filename, "/")
err = ar.Write(archiver.File{
@@ -128,6 +129,7 @@ func addFile(ar archiver.Writer, d *data, path, commonPath string) error {
if err != nil {
return err
}
+ }
if info.IsDir() {
names, err := file.Readdirnames(0)
