aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan <me@jordan.im>2023-01-08 20:21:28 -0700
committerJordan <me@jordan.im>2023-01-08 20:21:28 -0700
commita8f6c3ef6fa19e46f6ddf57177b5c6a178f77e4d (patch)
tree6cd4a4d1a2872c95c19eb3949be7685d5fb1f7e4
parent4967ef192ffa43d6789cf9916b00df677a774d7f (diff)
downloadcrane-a8f6c3ef6fa19e46f6ddf57177b5c6a178f77e4d.tar.gz
crane-a8f6c3ef6fa19e46f6ddf57177b5c6a178f77e4d.zip
crane: skip hidden directories during walk; exclude from category setHEADmaster
-rw-r--r--crane.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/crane.go b/crane.go
index b678f9d..d8d0fd2 100644
--- a/crane.go
+++ b/crane.go
@@ -145,7 +145,9 @@ func (papers *Papers) getUniqueName(category string, name string) string {
func (papers *Papers) findPapersWalk(path string, info os.FileInfo,
err error) error {
// skip the papers.Path root directory
- if p, _ := filepath.Abs(path); p == papers.Path {
+ if p, _ := filepath.Abs(path); p == papers.Path ||
+ strings.HasPrefix(filepath.Base(path), ".") {
+
return nil
}