fix: Ignore hidden folders when archiving (#4370)

Fixes #4369.
This commit is contained in:
Kyle Carberry
2022-10-04 22:27:14 +00:00
committed by GitHub
parent f2952000d9
commit 06d7e368ab
+5 -1
View File
@@ -75,7 +75,11 @@ func Tar(directory string, limit int64) ([]byte, error) {
if err != nil {
return err
}
if strings.HasPrefix(filepath.Base(rel), ".") {
if strings.HasPrefix(rel, ".") {
if fileInfo.IsDir() && rel != "." {
// Don't archive hidden files!
return filepath.SkipDir
}
// Don't archive hidden files!
return err
}