feat: add ability to specify which vars are required (#1204)

This commit is contained in:
Ben Coleman
2023-06-30 02:13:41 +01:00
committed by GitHub
parent f346015d8c
commit 307f39cee3
10 changed files with 165 additions and 3 deletions

View File

@@ -17,6 +17,7 @@ type Task struct {
Desc string
Prompt string
Summary string
Requires *Requires
Aliases []string
Sources []string
Generates []string
@@ -99,6 +100,7 @@ func (t *Task) UnmarshalYAML(node *yaml.Node) error {
IgnoreError bool `yaml:"ignore_error"`
Run string
Platforms []*Platform
Requires *Requires
}
if err := node.Decode(&task); err != nil {
return err
@@ -135,6 +137,7 @@ func (t *Task) UnmarshalYAML(node *yaml.Node) error {
t.IgnoreError = task.IgnoreError
t.Run = task.Run
t.Platforms = task.Platforms
t.Requires = task.Requires
return nil
}
@@ -178,6 +181,7 @@ func (t *Task) DeepCopy() *Task {
IncludedTaskfile: t.IncludedTaskfile.DeepCopy(),
Platforms: deepcopy.Slice(t.Platforms),
Location: t.Location.DeepCopy(),
Requires: t.Requires.DeepCopy(),
}
return c
}