Skip to content

Commit ee93448

Browse files
feat: updated utils.go
Signed-off-by: Asish Kumar <officialasishkumar@gmail.com>
1 parent f9a58dd commit ee93448

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

pkg/utils/utils.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ func TarDir(srcDir string, include []string, exclude []string, tarPath string) e
137137
tw := tar.NewWriter(fw)
138138
defer tw.Close()
139139

140+
fmt.Println(exclude)
141+
140142
err = filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error {
141143
if err != nil {
142144
return err
@@ -148,15 +150,17 @@ func TarDir(srcDir string, include []string, exclude []string, tarPath string) e
148150
}
149151
}
150152

153+
fmt.Println(path)
154+
151155
for _, ex := range exclude {
152156
if strings.Contains(path, ex) {
153157
return nil
154158
}
155159
}
156160

157161
for _, inc := range include {
158-
if strings.Contains(path, inc) {
159-
return nil
162+
if !strings.Contains(path, inc) {
163+
return nil
160164
}
161165
}
162166

0 commit comments

Comments
 (0)