From 06528321ccd9ff10ca83b5939f0a16c9d6793eb4 Mon Sep 17 00:00:00 2001 From: Nicolas De Loof Date: Sat, 6 Nov 2021 11:26:50 +0100 Subject: [PATCH] caller might not need a compose.yaml file until calling NewProjectOptions Signed-off-by: Nicolas De Loof --- cli/options.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cli/options.go b/cli/options.go index e7c277cf..72f21d08 100644 --- a/cli/options.go +++ b/cli/options.go @@ -24,7 +24,6 @@ import ( "regexp" "strings" - "github.com/compose-spec/compose-go/errdefs" "github.com/compose-spec/compose-go/loader" "github.com/compose-spec/compose-go/types" "github.com/compose-spec/godotenv" @@ -131,7 +130,8 @@ func WithDefaultConfigPath(o *ProjectOptions) error { } parent := filepath.Dir(pwd) if parent == pwd { - return errors.Wrap(errdefs.ErrNotFound, "can't find a suitable configuration file in this directory or any parent") + // no config file found, but that's not a blocker if caller only needs project name + return nil } pwd = parent } @@ -364,7 +364,6 @@ func getConfigPathsFromOptions(options *ProjectOptions) ([]string, error) { if len(options.ConfigPaths) != 0 { return absolutePaths(options.ConfigPaths) } - return nil, errors.New("no configuration file provided") }