config: isTemporaryFile -> isIgnoredFile

This commit is contained in:
Mitchell Hashimoto 2015-03-19 09:51:14 +01:00
parent 49f850f13b
commit f84ae29cf8

View File

@ -162,7 +162,7 @@ func dirFiles(dir string) ([]string, []string, error) {
// Only care about files that are valid to load
name := fi.Name()
extValue := ext(name)
if extValue == "" || isTemporaryFile(name) {
if extValue == "" || isIgnoredFile(name) {
continue
}
@ -183,10 +183,9 @@ func dirFiles(dir string) ([]string, []string, error) {
return files, overrides, nil
}
// isTemporaryFile returns true or false depending on whether the
// provided file name is a temporary file for the following editors:
// emacs or vim.
func isTemporaryFile(name string) bool {
// isIgnoredFile returns true or false depending on whether the
// provided file name is a file that should be ignored.
func isIgnoredFile(name string) bool {
return strings.HasPrefix(name, ".") || // Unix-like hidden files
strings.HasSuffix(name, "~") || // vim
(strings.HasPrefix(name, "#") && strings.HasSuffix(name, "#")) // emacs