From 52fc8b2503e3988ca8e70473c10897d259df0494 Mon Sep 17 00:00:00 2001 From: Martin Nirtl Date: Sun, 9 Feb 2020 13:02:45 +0100 Subject: [PATCH] exit on empty profileList --- internal/commands/profilecmd/list.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/internal/commands/profilecmd/list.go b/internal/commands/profilecmd/list.go index 64fe290..f3b3f32 100644 --- a/internal/commands/profilecmd/list.go +++ b/internal/commands/profilecmd/list.go @@ -21,6 +21,10 @@ var listCmd = &cobra.Command{ activeEnv := config.GetActiveEnv() profileNames := config.GetProfilesNames(activeEnv) + if len(profileNames) == 0 { + fmt.Printf("No profiles in %s. Create one with %s.\n", utils.PrintCyan(activeEnv), utils.PrintCyan("dockma profile create")) + } + for _, profileName := range profileNames { fmt.Printf("%s%s%s\n", chalk.Cyan, profileName, chalk.ResetColor)