Skip to content

Commit

Permalink
feat: updated utils.go
Browse files Browse the repository at this point in the history
Signed-off-by: Asish Kumar <[email protected]>
  • Loading branch information
officialasishkumar committed May 11, 2024
1 parent f9a58dd commit ee93448
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ func TarDir(srcDir string, include []string, exclude []string, tarPath string) e
tw := tar.NewWriter(fw)
defer tw.Close()

fmt.Println(exclude)

err = filepath.Walk(srcDir, func(path string, info os.FileInfo, err error) error {
if err != nil {
return err
Expand All @@ -148,15 +150,17 @@ func TarDir(srcDir string, include []string, exclude []string, tarPath string) e
}
}

fmt.Println(path)

for _, ex := range exclude {
if strings.Contains(path, ex) {
return nil
}
}

for _, inc := range include {
if strings.Contains(path, inc) {
return nil
if !strings.Contains(path, inc) {
return nil
}
}

Expand Down

0 comments on commit ee93448

Please sign in to comment.