diff --git a/runner.conf.sample b/runner.conf.sample index 5ac3c05..23a4beb 100644 --- a/runner.conf.sample +++ b/runner.conf.sample @@ -1,4 +1,5 @@ root: . +watch_path: . tmp_path: ./tmp build_name: runner-build build_log: runner-build-errors.log diff --git a/runner/settings.go b/runner/settings.go index 61e2412..deffbe4 100644 --- a/runner/settings.go +++ b/runner/settings.go @@ -18,6 +18,7 @@ const ( var settings = map[string]string{ "config_path": "./runner.conf", "root": ".", + "watch_path": ".", "tmp_path": "./tmp", "build_name": "runner-build", "build_log": "runner-build-errors.log", @@ -108,6 +109,10 @@ func root() string { return settings["root"] } +func watchPath() string { + return settings["watch_path"] +} + func tmpPath() string { return settings["tmp_path"] } diff --git a/runner/watcher.go b/runner/watcher.go index 7df2706..d5e24db 100644 --- a/runner/watcher.go +++ b/runner/watcher.go @@ -36,8 +36,8 @@ func watchFolder(path string) { } func watch() { - root := root() - filepath.Walk(root, func(path string, info os.FileInfo, err error) error { + watchPath := watchPath() + filepath.Walk(watchPath, func(path string, info os.FileInfo, err error) error { if info.IsDir() && !isTmpDir(path) { if len(path) > 1 && strings.HasPrefix(filepath.Base(path), ".") { return filepath.SkipDir