1
0
mirror of https://github.com/go-task/task.git synced 2025-11-29 22:48:03 +02:00

Issue 813. Made watch interval configurable through global setting in Taskfile and through CLI arg.

Separated Taskfile param and Arg flag
This commit is contained in:
ilewin
2022-09-08 19:22:44 +02:00
parent 160b788198
commit 1c44d8049a
7 changed files with 122 additions and 1 deletions

View File

@@ -18,6 +18,7 @@ type Taskfile struct {
Silent bool
Dotenv []string
Run string
Interval string
}
// UnmarshalYAML implements yaml.Unmarshaler interface
@@ -34,10 +35,13 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
Silent bool
Dotenv []string
Run string
Interval string
}
if err := unmarshal(&taskfile); err != nil {
return err
}
tf.Version = taskfile.Version
tf.Expansions = taskfile.Expansions
tf.Output = taskfile.Output
@@ -49,6 +53,8 @@ func (tf *Taskfile) UnmarshalYAML(unmarshal func(interface{}) error) error {
tf.Silent = taskfile.Silent
tf.Dotenv = taskfile.Dotenv
tf.Run = taskfile.Run
tf.Interval = taskfile.Interval
if tf.Expansions <= 0 {
tf.Expansions = 2
}