diff --git a/cmd/switch.go b/cmd/switch.go index fb34ab6..9c64f6b 100644 --- a/cmd/switch.go +++ b/cmd/switch.go @@ -39,7 +39,10 @@ var switchCmd = &cobra.Command{ envs, err := utils.GetEnvironments(dbProject.ID) utils.StopIfErr(err) - if len(envs) == 2 { + if len(envs) == 1 { + utils.ErrPrint("Cannot switch when there is only one environment.") + os.Exit(1) + } else if len(envs) == 2 { for _, en := range envs { if en.Name != current { env = en.Name