Skip to content

Commit

Permalink
Merge pull request #32395 from vespa-engine/mpolden/always-ignore
Browse files Browse the repository at this point in the history
Always ignore some files in application package
  • Loading branch information
jonmv authored Sep 12, 2024
2 parents 6b331d1 + 984c6ef commit df4260f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion client/go/internal/vespa/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@ func (ap *ApplicationPackage) Validate() error {

func isZip(filename string) bool { return filepath.Ext(filename) == ".zip" }

func alwaysIgnore(filename string) bool {
switch filepath.Base(filename) {
case ".DS_Store":
return true
}
return false
}

func zipDir(dir string, destination string, ignores *ignore.List) error {
if !ioutil.Exists(dir) {
message := "'" + dir + "' should be an application package zip or dir, but does not exist"
Expand All @@ -108,7 +116,7 @@ func zipDir(dir string, destination string, ignores *ignore.List) error {
if err != nil {
return err
}
if ignores.Match(zipPath) {
if alwaysIgnore(path) || ignores.Match(zipPath) {
if info.IsDir() {
return filepath.SkipDir
}
Expand Down

0 comments on commit df4260f

Please sign in to comment.