Skip to content

Commit

Permalink
🐛 c.PlanRaw can be nil (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
MadsBogeskov committed Nov 28, 2023
1 parent eb66e56 commit 24216f7
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pkg/config/shuttleconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 24216f7

Please sign in to comment.