File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ package walker
2
2
3
3
import (
4
4
"os"
5
- "path"
6
5
"path/filepath"
7
6
"strings"
8
7
@@ -80,7 +79,7 @@ func (w *walker) shouldSkipDir(dir string) bool {
80
79
81
80
// Skip system dirs and specified dirs (absolute path)
82
81
for _ , pattern := range w .skipDirs {
83
- if match , err := path .Match (pattern , dir ); err != nil {
82
+ if match , err := doublestar .Match (pattern , dir ); err != nil {
84
83
return false // return early if bad pattern
85
84
} else if match {
86
85
log .Logger .Debugf ("Skipping directory: %s" , dir )
Original file line number Diff line number Diff line change @@ -104,6 +104,13 @@ func Test_shouldSkipDir(t *testing.T) {
104
104
filepath .Join ("/etc/foo/bar" ): false ,
105
105
},
106
106
},
107
+ {
108
+ skipDirs : []string {"**/.terraform" },
109
+ skipMap : map [string ]bool {
110
+ ".terraform" : true ,
111
+ "test/foo/bar/.terraform" : true ,
112
+ },
113
+ },
107
114
}
108
115
109
116
for i , tc := range testCases {
You can’t perform that action at this time.
0 commit comments