diff --git a/tpl/template_resources.go b/tpl/template_resources.go index f49e7df6f..1fe94af88 100644 --- a/tpl/template_resources.go +++ b/tpl/template_resources.go @@ -267,15 +267,15 @@ func GetCSV(sep string, urlParts ...string) [][]string { } func ReadDir(path string) []os.FileInfo { - wd := "" - p := "" + wd := "" + p := "" if viper.GetString("WorkingDir") != "" { wd = viper.GetString("WorkingDir") } - if strings.Contains(path, "..") { - jww.ERROR.Printf("Path contains parent directory marker ..\n", path) + if strings.Contains(path, "..") { + jww.ERROR.Printf("Path %s contains parent directory marker", path) return nil - } + } p = filepath.Clean(path) p = filepath.Join(wd, p)