mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-14 14:01:26 +00:00
25 lines
354 B
Go
25 lines
354 B
Go
|
package output
|
||
|
|
||
|
import (
|
||
|
"errors"
|
||
|
"strings"
|
||
|
)
|
||
|
|
||
|
var ErrOutputOptionRequired = errors.New("output option required")
|
||
|
|
||
|
func ParseOutputOptions(out string) (string, []string) {
|
||
|
out, opt, found := strings.Cut(out, "=")
|
||
|
|
||
|
if !found {
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
var optList []string
|
||
|
|
||
|
if opt != "" {
|
||
|
optList = strings.Split(opt, ",")
|
||
|
}
|
||
|
|
||
|
return out, optList
|
||
|
}
|