From f96a917fea2989ae62dde831eec17241170abeb8 Mon Sep 17 00:00:00 2001 From: Suraj B M Date: Sun, 28 Sep 2025 10:55:23 +0530 Subject: [PATCH] feat: cant switch if only one env exists --- cmd/switch.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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