From 24216f7d83dce40bd36fc27a2458ccb1974e7fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20B=C3=B8geskov?= Date: Tue, 28 Nov 2023 09:55:24 +0100 Subject: [PATCH] :bug: c.PlanRaw can be nil (#196) --- pkg/config/shuttleconfig.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pkg/config/shuttleconfig.go b/pkg/config/shuttleconfig.go index d841f80..153251b 100644 --- a/pkg/config/shuttleconfig.go +++ b/pkg/config/shuttleconfig.go @@ -118,12 +118,21 @@ func (c *ShuttleConfig) getConf(projectPath string, strictConfigLookup bool) (st ) } + if c.PlanRaw == nil { + return "", shuttleerrors.NewExitCode( + 2, + "Failed to parse shuttle configuration: %s\n\nFailed to find a `plan`. Make sure your 'shuttle.yaml' is valid.", + err, + ) + } + switch c.PlanRaw { case false: // no plan default: c.Plan = c.PlanRaw.(string) } + // return the path where the shuttle.yaml file was found return path.Dir(file.Name()), nil }