From ed70559d4fd2932a970edeaa41283a6a26497ef5 Mon Sep 17 00:00:00 2001 From: Greg Linton Date: Fri, 18 Aug 2017 10:43:56 -0600 Subject: [PATCH 1/2] Unify removing an evar (case insensitivity) Resolves #537 --- commands/evar/remove.go | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/commands/evar/remove.go b/commands/evar/remove.go index 2b36e0ec..cf0cbd83 100644 --- a/commands/evar/remove.go +++ b/commands/evar/remove.go @@ -1,7 +1,7 @@ package evar import ( - // "fmt" + "fmt" "strings" "github.com/spf13/cobra" @@ -15,9 +15,9 @@ import ( "github.com/nanobox-io/nanobox/util/display" ) -// RemoveCmd ... +// RemoveCmd removes an evar. var RemoveCmd = &cobra.Command{ - Use: "rm", + Use: "rm [local|dry-run] key", Short: "Remove environment variable(s)", Long: ``, // PreRun: steps.Run("login"), @@ -29,6 +29,18 @@ func removeFn(ccmd *cobra.Command, args []string) { // parse the evars excluding the context env, _ := models.FindEnvByID(config.EnvID()) args, location, name := helpers.Endpoint(env, args, 0) + + if len(args) < 1 { + fmt.Printf(` +-------------------------------------------- +Please provide the key you'd like to remove! +-------------------------------------------- + +`) + ccmd.HelpFunc()(ccmd, args) + return + } + evars := parseKeys(args) switch location { @@ -50,7 +62,7 @@ func parseKeys(args []string) []string { for _, arg := range args { for _, key := range strings.Split(arg, ",") { if key != "" { - keys = append(keys, key) + keys = append(keys, strings.ToUpper(key)) } } } From a83ec7a4c1a22cb3ae6615992f31521933f7de4d Mon Sep 17 00:00:00 2001 From: Greg Linton Date: Fri, 18 Aug 2017 10:51:39 -0600 Subject: [PATCH 2/2] Check for updates more frequently --- util/update/check.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util/update/check.go b/util/update/check.go index 24f843cb..90454610 100644 --- a/util/update/check.go +++ b/util/update/check.go @@ -9,8 +9,8 @@ import ( "github.com/nanobox-io/nanobox/models" ) -// Check for updates to nanobox once a week -const checkFrequency = (168 * time.Hour) +// Check for updates to nanobox every other day +const checkFrequency = (48 * time.Hour) // Check checks to see if there is an update available for the nanobox CLI func Check() {