mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 09:17:49 +08:00
ensure call aliases also work formatting parameters
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
ef4a165e48
commit
0902294e1a
@ -12,17 +12,10 @@ import (
|
||||
const defaultPrintFunc = "build"
|
||||
|
||||
func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
||||
if str == "" || str == defaultPrintFunc {
|
||||
if str == "" {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
// "check" has been added as an alias for "lint",
|
||||
// in order to maintain backwards compatibility
|
||||
// we need to convert it.
|
||||
if str == "check" {
|
||||
str = "lint"
|
||||
}
|
||||
|
||||
csvReader := csv.NewReader(strings.NewReader(str))
|
||||
fields, err := csvReader.Read()
|
||||
if err != nil {
|
||||
@ -51,5 +44,17 @@ func ParsePrintFunc(str string) (*controllerapi.PrintFunc, error) {
|
||||
f.Name = field
|
||||
}
|
||||
}
|
||||
|
||||
// "check" has been added as an alias for "lint",
|
||||
// in order to maintain backwards compatibility
|
||||
// we need to convert it.
|
||||
if f.Name == "check" {
|
||||
f.Name = "lint"
|
||||
}
|
||||
|
||||
if f.Name == defaultPrintFunc {
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
return f, nil
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user