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:
9
task.go
9
task.go
@ -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)
|
||||
|
Reference in New Issue
Block a user