From 00609adb8f9c1fdecbafc1098e5ae0635b24cf34 Mon Sep 17 00:00:00 2001 From: Adam Mathes Date: Mon, 13 Feb 2017 21:27:59 -0800 Subject: add ignored_files configuration setting --- config/config.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'config/config.go') diff --git a/config/config.go b/config/config.go index c8b702b..c02d163 100644 --- a/config/config.go +++ b/config/config.go @@ -26,6 +26,8 @@ type Settings struct { PreviewServer string `yaml:"preview_server,omitempty"` PreviewDir string `yaml:"preview_dir,omitempty"` + FileBlacklist []string `yaml:"ignore_files,omitempty"` + Verbose bool `yaml:"verbose,omitempty"` } @@ -79,3 +81,13 @@ func addDefaults() { Config.PreviewDir = Config.HtmlDir } } + +// IgnoredFile returns true if `filename` is in the ignored_files config +func IgnoredFile(filename string) bool { + for _, badFile := range Config.FileBlacklist { + if filename == badFile { + return true + } + } + return false +} -- cgit v1.2.3