1
0
mirror of https://github.com/go-task/task.git synced 2025-06-15 00:15:10 +02:00

Watch task

This commit is contained in:
Andrey Nering
2017-04-01 16:04:52 -03:00
parent 36614dccf8
commit 72a6727e31
4 changed files with 116 additions and 0 deletions

View File

@ -18,6 +18,8 @@ var (
// Force (--force or -f flag) forces a task to run even when it's up-to-date
Force bool
// Watch (--watch or -w flag) enables watch of a task
Watch bool
// Tasks constains the tasks parsed from Taskfile
Tasks = make(map[string]*Task)
@ -66,6 +68,13 @@ func Run() {
}
}
if Watch {
if err := WatchTasks(args); err != nil {
log.Fatal(err)
}
return
}
for _, a := range args {
if err = RunTask(a); err != nil {
log.Fatal(err)