Skip to content

Commit

Permalink
add breakOnFail flag
Browse files Browse the repository at this point in the history
  • Loading branch information
Enapiuz committed May 14, 2019
1 parent 72f6cc4 commit 3e9f43d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion multiwatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ commands = ["make imports"]
name = "something"
paths = ["vendor/github.com"]
ignorePrefixes = ["vendor"]
commands = ["sleep 1", "sleep 1", "ls /sfsdfsdf"]
commands = ["sleep 1", "ls /1231231231", "sleep 1", "ls /sfsdfsdf"]
breakOnFail = true
1 change: 1 addition & 0 deletions types/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ type DirectoryConfig struct {
Paths []string
IgnorePrefixes []string
Commands []string
BreakOnFail bool
}

// Config Application config
Expand Down
3 changes: 3 additions & 0 deletions watcher/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ func (w *Watcher) runCommands() bool {
if err != nil {
w.errorLog += fmt.Sprintf("[%s]:\n%s%s", command, outBuffer.String(), errBuffer.String())
result = false
if w.config.BreakOnFail {
break
}
}
}
return result
Expand Down

0 comments on commit 3e9f43d

Please sign in to comment.