Skip to content
This repository has been archived by the owner on Jun 9, 2022. It is now read-only.

Commit

Permalink
rename NoEnvs func to PrintNoEnvs
Browse files Browse the repository at this point in the history
  • Loading branch information
martinnirtl committed Feb 17, 2020
1 parent 589eaf7 commit 75d20c5
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion internal/commands/downcmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var DownCommand = &cobra.Command{
activeEnv := viper.GetString("active")

if activeEnv == "-" {
utils.NoEnvs()
utils.PrintNoEnvs()
}

envHomeDir := viper.GetString(fmt.Sprintf("envs.%s.home", activeEnv))
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/envcmd/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ var pullCommand = &cobra.Command{
activeEnv := config.GetActiveEnv()

if activeEnv.GetName() == "-" {
utils.NoEnvs()
utils.PrintNoEnvs()
}

envHomeDir := activeEnv.GetHomeDir()
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/logscmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ var LogsCommand = &cobra.Command{
activeEnv := viper.GetString("active")

if activeEnv == "-" {
utils.NoEnvs()
utils.PrintNoEnvs()
}

envHomeDir := viper.GetString(fmt.Sprintf("envs.%s.home", activeEnv))
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/pscmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var PSCommand = &cobra.Command{
activeEnv := viper.GetString("active")

if activeEnv == "-" {
utils.NoEnvs()
utils.PrintNoEnvs()
}

envHomeDir := viper.GetString(fmt.Sprintf("envs.%s.home", activeEnv))
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/upcmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ var UpCommand = &cobra.Command{
activeEnv := config.GetActiveEnv()

if activeEnv.GetName() == "-" {
utils.NoEnvs()
utils.PrintNoEnvs()
}

envHomeDir := activeEnv.GetHomeDir()
Expand Down
4 changes: 2 additions & 2 deletions internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func ErrorAndExit(err error) {
}
}

// NoEnvs prints no envs configured and exits
func NoEnvs() {
// PrintNoEnvs prints no envs configured and exits
func PrintNoEnvs() {
fmt.Printf("No environments configured. Add new environment with %sdockma envs init%s.\n", chalk.Cyan, chalk.ResetColor)

os.Exit(0)
Expand Down

0 comments on commit 75d20c5

Please sign in to comment.