From 984c6ef16975738601a09549453329538528bcdc Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Thu, 12 Sep 2024 15:32:14 +0300 Subject: [PATCH] Always ignore some files in application package --- client/go/internal/vespa/application.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/client/go/internal/vespa/application.go b/client/go/internal/vespa/application.go index d499006c9820..d36da7d07629 100644 --- a/client/go/internal/vespa/application.go +++ b/client/go/internal/vespa/application.go @@ -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" @@ -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 }