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

Issue #519: Allow includes to be optional

This commit is contained in:
Sally Young
2021-08-11 17:28:44 +01:00
parent 50e5813222
commit 8f80fc4e2c
8 changed files with 93 additions and 1 deletions

View File

@ -10,6 +10,7 @@ import (
type IncludedTaskfile struct {
Taskfile string
Dir string
Optional bool
AdvancedImport bool
}
@ -92,12 +93,14 @@ func (it *IncludedTaskfile) UnmarshalYAML(unmarshal func(interface{}) error) err
var includedTaskfile struct {
Taskfile string
Dir string
Optional bool
}
if err := unmarshal(&includedTaskfile); err != nil {
return err
}
it.Dir = includedTaskfile.Dir
it.Taskfile = includedTaskfile.Taskfile
it.Dir = includedTaskfile.Dir
it.Optional = includedTaskfile.Optional
it.AdvancedImport = true
return nil
}