From f794f30b7daead0d649eaa7a7e70dbc27e4664ae Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Wed, 18 Mar 2015 07:49:39 +0000 Subject: [PATCH] Ignore hidden files per Unix conventions --- config/loader.go | 4 ++-- config/test-fixtures/dir-temporary-files/.hidden.tf | 0 2 files changed, 2 insertions(+), 2 deletions(-) create mode 100644 config/test-fixtures/dir-temporary-files/.hidden.tf diff --git a/config/loader.go b/config/loader.go index a1bd196d1..fe1494ff8 100644 --- a/config/loader.go +++ b/config/loader.go @@ -187,7 +187,7 @@ func dirFiles(dir string) ([]string, []string, error) { // provided file name is a temporary file for the following editors: // emacs or vim. func isTemporaryFile(name string) bool { - return strings.HasSuffix(name, "~") || // vim - strings.HasPrefix(name, ".#") || // emacs + return strings.HasPrefix(name, ".") || // Unix-like hidden files + strings.HasSuffix(name, "~") || // vim (strings.HasPrefix(name, "#") && strings.HasSuffix(name, "#")) // emacs } diff --git a/config/test-fixtures/dir-temporary-files/.hidden.tf b/config/test-fixtures/dir-temporary-files/.hidden.tf new file mode 100644 index 000000000..e69de29bb