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

Commit

Permalink
change format of success messages
Browse files Browse the repository at this point in the history
  • Loading branch information
martinnirtl committed Mar 17, 2020
1 parent 1d4ef8e commit 886bfe2
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 @@ -47,7 +47,7 @@ func runDownCommand(cmd *cobra.Command, args []string) {
}
utils.ErrorAndExit(err)

utils.Success("Executed command: docker-compose down")
utils.Success(fmt.Sprintf("Executed command: %s", chalk.Cyan.Color("docker-compose down")))

viper.Set(fmt.Sprintf("envs.%s.running", activeEnv.GetName()), false)
config.Save("", fmt.Errorf("Failed to set environment %s to %s", chalk.Underline.TextStyle(activeEnv.GetName()), chalk.Underline.TextStyle("not running")))
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 @@ -84,7 +84,7 @@ func runPullCommand(cmd *cobra.Command, args []string) {
}
utils.ErrorAndExit(err)

utils.Success(fmt.Sprintf("Pulled environment: %s", env.GetName()))
utils.Success(fmt.Sprintf("Pulled environment: %s", chalk.Cyan.Color(env.GetName())))
}

// Pull runs git pull in given path and optionally logs output
Expand Down
2 changes: 1 addition & 1 deletion internal/commands/restartcmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ func runRestartCommand(cmd *cobra.Command, args []string) {
}
utils.ErrorAndExit(err)

utils.Success(fmt.Sprintf("Executed command: %s", command))
utils.Success(fmt.Sprintf("Executed command: %s", chalk.Cyan.Color(command)))
}
2 changes: 1 addition & 1 deletion internal/commands/scriptcmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,5 +78,5 @@ func runScriptCommand(cmd *cobra.Command, args []string) {
_, err = externalcommand.Execute(command, nil, "")
utils.ErrorAndExit(err)

utils.Success(fmt.Sprintf("Executed script: %s", scriptname))
utils.Success(fmt.Sprintf("Executed script: %s", chalk.Cyan.Color(scriptname)))
}
4 changes: 2 additions & 2 deletions internal/commands/upcmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func runUpCommand(cmd *cobra.Command, args []string) {
viper.Set(fmt.Sprintf("envs.%s.running", activeEnv.GetName()), true)
config.Save("", fmt.Errorf("Failed to set environment %s to %s", chalk.Underline.TextStyle(activeEnv.GetName()), chalk.Underline.TextStyle("running")))

utils.Success("Executed command: docker-compose up")
utils.Success(fmt.Sprintf("Executed command: %s", chalk.Cyan.Color("docker-compose up")))
}

func pull(activeEnv config.Env) {
Expand Down Expand Up @@ -182,7 +182,7 @@ func pull(activeEnv config.Env) {

fmt.Println() // Add empty line for better readability
} else {
utils.Success(fmt.Sprintf("Pulled environment: %s", activeEnv.GetName()))
utils.Success(fmt.Sprintf("Pulled environment: %s", chalk.Cyan.Color(activeEnv.GetName())))
}
}
}
2 changes: 1 addition & 1 deletion internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func Abort() {

// Success prints green colored text to std out
func Success(text string) {
fmt.Println(chalk.Green.Color(text))
fmt.Println(fmt.Sprintf("%s %s", chalk.Green.Color("✔"), text))
}

// Warn prints yellow colored text to std out
Expand Down

0 comments on commit 886bfe2

Please sign in to comment.