Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow watch path and root to be set independently #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions runner.conf.sample
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
root: .
watch_path: .
tmp_path: ./tmp
build_name: runner-build
build_log: runner-build-errors.log
Expand Down
5 changes: 5 additions & 0 deletions runner/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -108,6 +109,10 @@ func root() string {
return settings["root"]
}

func watchPath() string {
return settings["watch_path"]
}

func tmpPath() string {
return settings["tmp_path"]
}
Expand Down
4 changes: 2 additions & 2 deletions runner/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down