Skip to content

Commit

Permalink
Merge pull request #539 from nanobox-io/bugfix/537
Browse files Browse the repository at this point in the history
Unify removing an evar (case insensitivity)
  • Loading branch information
glinton authored Aug 18, 2017
2 parents 41a844a + a83ec7a commit 2ebfcfa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
20 changes: 16 additions & 4 deletions commands/evar/remove.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package evar

import (
// "fmt"
"fmt"
"strings"

"github.com/spf13/cobra"
Expand All @@ -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"),
Expand All @@ -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 {
Expand All @@ -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))
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions util/update/check.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 2ebfcfa

Please sign in to comment.