Skip to content

Commit 06d7e36

Browse files
authored
fix: Ignore hidden folders when archiving (coder#4370)
Fixes coder#4369.
1 parent f295200 commit 06d7e36

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

provisionersdk/archive.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,11 @@ func Tar(directory string, limit int64) ([]byte, error) {
7575
if err != nil {
7676
return err
7777
}
78-
if strings.HasPrefix(filepath.Base(rel), ".") {
78+
if strings.HasPrefix(rel, ".") {
79+
if fileInfo.IsDir() && rel != "." {
80+
// Don't archive hidden files!
81+
return filepath.SkipDir
82+
}
7983
// Don't archive hidden files!
8084
return err
8185
}

0 commit comments

Comments
 (0)