From 679047f8465b25761ac361a0f41c0b8e814f1928 Mon Sep 17 00:00:00 2001 From: Nick White Date: Tue, 15 Jun 2021 12:50:58 +0100 Subject: pipeline: Ignore hidden files when checking and uploading This prevents issues if a .DS_Store file is present in a directory. --- internal/pipeline/put.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal') 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 } -- cgit v1.2.1-24-ge1ad