Allow setting global variables through the CLI

Closes #192
This commit is contained in:
Andrey Nering
2019-05-11 11:06:47 -03:00
parent 0233ce52ed
commit f0768b3af1
5 changed files with 55 additions and 31 deletions

View File

@@ -121,9 +121,9 @@ func main() {
arguments = []string{"default"}
}
calls, err := args.Parse(arguments...)
if err != nil {
log.Fatal(err)
calls, globals := args.Parse(arguments...)
for name, value := range globals {
e.Taskfile.Vars[name] = value
}
ctx := context.Background()
@@ -132,7 +132,7 @@ func main() {
}
if status {
if err = e.Status(ctx, calls...); err != nil {
if err := e.Status(ctx, calls...); err != nil {
log.Fatal(err)
}
return