diff --git a/cli/options.go b/cli/options.go index b2ab60e8..caa07666 100644 --- a/cli/options.go +++ b/cli/options.go @@ -414,7 +414,7 @@ func (o *ProjectOptions) ReadConfigFiles(ctx context.Context, workingDir string, for i, c := range config.ConfigFiles { var err error var b []byte - if c.Filename == "-" { + if c.IsStdin() { b, err = io.ReadAll(os.Stdin) if err != nil { return nil, err diff --git a/types/config.go b/types/config.go index a2382fb3..d73d2b9f 100644 --- a/types/config.go +++ b/types/config.go @@ -67,6 +67,10 @@ type ConfigFile struct { Config map[string]interface{} } +func (cf ConfigFile) IsStdin() bool { + return cf.Filename == "-" +} + func ToConfigFiles(path []string) (f []ConfigFile) { for _, p := range path { f = append(f, ConfigFile{Filename: p})