From 3493b08f20a88f5002d1af1f97b2e1642176b72d Mon Sep 17 00:00:00 2001 From: Andy Cooper Date: Thu, 28 Jun 2018 15:27:09 -0400 Subject: [PATCH] Streamline message names --- messages/messages.go | 16 ++++++++-------- version/version.go | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/messages/messages.go b/messages/messages.go index 9da6c3a26..8c2389cde 100644 --- a/messages/messages.go +++ b/messages/messages.go @@ -4,14 +4,14 @@ var ( ERROR_INVALID_CLI_VERSION = "Astronomer CLI version is not valid" ERROR_GITHUB_JSON_MARSHALLING = "Failed to JSON decode Github response from %s" - INFO_CURR_CLI_VERSION = "Astro CLI Version: v%s" - INFO_CURR_CLI_COMMIT = "Git Commit: %s" - INFO_CURR_CLI_VERSION_DATE = INFO_CURR_CLI_VERSION + " (%s)" - INFO_LATEST_CLI_VERSION = "Astro CLI Latest: %s " - INFO_LATEST_CLI_VERSION_DATE = INFO_LATEST_CLI_VERSION + " (%s)" - INFO_CLI_INSTALL_CMD = "\t$ curl -sL https://install.astronomer.io | sudo bash" - INFO_UPGRADE_CLI = "There is a more recent version of the Astronomer CLI available.\nYou can install the latest tagged release with the following command" - INFO_UNTAGGED_VERSION = "Your current Astronomer CLI is not tagged.\nThis is likely the result of building from source. You can install the latest tagged release with the following command" + CLI_CURR_VERSION = "Astro CLI Version: v%s" + CLI_CURR_COMMIT = "Git Commit: %s" + CLI_CURR_VERSION_DATE = CLI_CURR_VERSION + " (%s)" + CLI_LATEST_VERSION = "Astro CLI Latest: %s " + CLI_LATEST_VERSION_DATE = CLI_LATEST_VERSION + " (%s)" + CLI_INSTALL_CMD = "\t$ curl -sL https://install.astronomer.io | sudo bash" + CLI_UPGRADE_PROMPT = "There is a more recent version of the Astronomer CLI available.\nYou can install the latest tagged release with the following command" + CLI_UNTAGGED_PROMPT = "Your current Astronomer CLI is not tagged.\nThis is likely the result of building from source. You can install the latest tagged release with the following command" NA = "N/A" ) diff --git a/version/version.go b/version/version.go index 1e719c80f..a21e182c5 100644 --- a/version/version.go +++ b/version/version.go @@ -18,16 +18,16 @@ func PrintVersion(version, gitCommit string) error { return errors.New(messages.ERROR_INVALID_CLI_VERSION) } - fmt.Printf(messages.INFO_CURR_CLI_VERSION+"\n", version) - fmt.Printf(messages.INFO_CURR_CLI_COMMIT+"\n", gitCommit) + fmt.Printf(messages.CLI_CURR_VERSION+"\n", version) + fmt.Printf(messages.CLI_CURR_COMMIT+"\n", gitCommit) return nil } // CheckForUpdate checks current version against latest on github func CheckForUpdate(version, gitCommit string) error { if !isValidVersion(version) { - fmt.Println(messages.INFO_UNTAGGED_VERSION) - fmt.Println(messages.INFO_CLI_INSTALL_CMD) + fmt.Println(messages.CLI_UNTAGGED_PROMPT) + fmt.Println(messages.CLI_INSTALL_CMD) return nil } @@ -49,10 +49,10 @@ func CheckForUpdate(version, gitCommit string) error { latestTag := latestTagResp.TagName if latestTagResp.TagName > version { - fmt.Printf(messages.INFO_CURR_CLI_VERSION_DATE+"\n", version, currentPub) - fmt.Printf(messages.INFO_LATEST_CLI_VERSION_DATE+"\n", latestTag, latestPub) - fmt.Println(messages.INFO_UPGRADE_CLI) - fmt.Println(messages.INFO_CLI_INSTALL_CMD) + fmt.Printf(messages.CLI_CURR_VERSION_DATE+"\n", version, currentPub) + fmt.Printf(messages.CLI_LATEST_VERSION_DATE+"\n", latestTag, latestPub) + fmt.Println(messages.CLI_UPGRADE_PROMPT) + fmt.Println(messages.CLI_INSTALL_CMD) return nil }