mirror of
https://github.com/go-task/task.git
synced 2025-06-23 00:38:19 +02:00
feat: add option to declare an included Taskfile as flatten (#1704)
This commit is contained in:
@ -17,6 +17,7 @@ type Include struct {
|
||||
Aliases []string
|
||||
AdvancedImport bool
|
||||
Vars *Vars
|
||||
Flatten bool
|
||||
}
|
||||
|
||||
// Includes represents information about included tasksfiles
|
||||
@ -81,6 +82,7 @@ func (include *Include) UnmarshalYAML(node *yaml.Node) error {
|
||||
Dir string
|
||||
Optional bool
|
||||
Internal bool
|
||||
Flatten bool
|
||||
Aliases []string
|
||||
Vars *Vars
|
||||
}
|
||||
@ -94,6 +96,7 @@ func (include *Include) UnmarshalYAML(node *yaml.Node) error {
|
||||
include.Aliases = includedTaskfile.Aliases
|
||||
include.AdvancedImport = true
|
||||
include.Vars = includedTaskfile.Vars
|
||||
include.Flatten = includedTaskfile.Flatten
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -114,5 +117,6 @@ func (include *Include) DeepCopy() *Include {
|
||||
Internal: include.Internal,
|
||||
AdvancedImport: include.AdvancedImport,
|
||||
Vars: include.Vars.DeepCopy(),
|
||||
Flatten: include.Flatten,
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user