1
0
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:
Valentin Maerten
2024-08-26 23:17:39 +02:00
committed by GitHub
parent f302b50519
commit ef3b853728
15 changed files with 272 additions and 38 deletions

View File

@ -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,
}
}