summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorNick White <git@njw.name>2021-06-15 12:50:58 +0100
committerNick White <git@njw.name>2021-06-15 12:50:58 +0100
commit679047f8465b25761ac361a0f41c0b8e814f1928 (patch)
tree979242e25a7d090226a1d578b84eb469ea0f12c5 /internal
parent1ba408a79a585ec1a4ac06bdab19267376bfb676 (diff)
pipeline: Ignore hidden files when checking and uploading
This prevents issues if a .DS_Store file is present in a directory.
Diffstat (limited to 'internal')
-rw-r--r--internal/pipeline/put.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/internal/pipeline/put.go b/internal/pipeline/put.go
index 4b38ea5..87e4c99 100644
--- a/internal/pipeline/put.go
+++ b/internal/pipeline/put.go
@@ -1,4 +1,4 @@
-// Copyright 2020 Nick White.
+// Copyright 2021 Nick White.
// Use of this source code is governed by the GPLv3
// license that can be found in the LICENSE file.
@@ -11,6 +11,7 @@ import (
_ "image/png"
"os"
"path/filepath"
+ "strings"
)
// null writer to enable non-verbose logging to be discarded
@@ -26,6 +27,11 @@ func (f fileWalk) Walk(path string, info os.FileInfo, err error) error {
if err != nil {
return err
}
+ // skip files starting with . to prevent automatically generated
+ // files like .DS_Store getting in the way
+ if strings.HasPrefix(filepath.Base(path), ".") {
+ return nil
+ }
if !info.IsDir() {
f <- path
}