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

Add support for 'platforms' in both task and command (#980)

This commit is contained in:
Lea Anthony
2023-01-07 11:38:35 +11:00
committed by GitHub
parent 63c50d13ee
commit aa6c7e4b94
10 changed files with 295 additions and 0 deletions

View File

@ -36,6 +36,7 @@ type Task struct {
IncludeVars *Vars
IncludedTaskfileVars *Vars
IncludedTaskfile *IncludedTaskfile
Platforms []*Platform
}
func (t *Task) Name() string {
@ -90,6 +91,7 @@ func (t *Task) UnmarshalYAML(node *yaml.Node) error {
Prefix string
IgnoreError bool `yaml:"ignore_error"`
Run string
Platforms []*Platform
}
if err := node.Decode(&task); err != nil {
return err
@ -115,6 +117,7 @@ func (t *Task) UnmarshalYAML(node *yaml.Node) error {
t.Prefix = task.Prefix
t.IgnoreError = task.IgnoreError
t.Run = task.Run
t.Platforms = task.Platforms
return nil
}
@ -150,6 +153,7 @@ func (t *Task) DeepCopy() *Task {
IncludeVars: t.IncludeVars.DeepCopy(),
IncludedTaskfileVars: t.IncludedTaskfileVars.DeepCopy(),
IncludedTaskfile: t.IncludedTaskfile.DeepCopy(),
Platforms: deepCopySlice(t.Platforms),
}
return c
}