diff options
Diffstat (limited to 'cmd/ship/env')
| -rw-r--r-- | cmd/ship/env/list.go | 3 | ||||
| -rw-r--r-- | cmd/ship/env/set.go | 3 | ||||
| -rw-r--r-- | cmd/ship/env/unset.go | 3 |
3 files changed, 9 insertions, 0 deletions
diff --git a/cmd/ship/env/list.go b/cmd/ship/env/list.go index ad76eb6..e94b83a 100644 --- a/cmd/ship/env/list.go +++ b/cmd/ship/env/list.go | |||
| @@ -17,6 +17,9 @@ var listCmd = &cobra.Command{ | |||
| 17 | 17 | ||
| 18 | func runList(cmd *cobra.Command, args []string) error { | 18 | func runList(cmd *cobra.Command, args []string) error { |
| 19 | name := args[0] | 19 | name := args[0] |
| 20 | if err := state.ValidateName(name); err != nil { | ||
| 21 | return err | ||
| 22 | } | ||
| 20 | 23 | ||
| 21 | st, err := state.Load() | 24 | st, err := state.Load() |
| 22 | if err != nil { | 25 | if err != nil { |
diff --git a/cmd/ship/env/set.go b/cmd/ship/env/set.go index e11d2c9..d4292f3 100644 --- a/cmd/ship/env/set.go +++ b/cmd/ship/env/set.go | |||
| @@ -25,6 +25,9 @@ func init() { | |||
| 25 | 25 | ||
| 26 | func runSet(cmd *cobra.Command, args []string) error { | 26 | func runSet(cmd *cobra.Command, args []string) error { |
| 27 | name := args[0] | 27 | name := args[0] |
| 28 | if err := state.ValidateName(name); err != nil { | ||
| 29 | return err | ||
| 30 | } | ||
| 28 | envVars := args[1:] | 31 | envVars := args[1:] |
| 29 | 32 | ||
| 30 | st, err := state.Load() | 33 | st, err := state.Load() |
diff --git a/cmd/ship/env/unset.go b/cmd/ship/env/unset.go index 7d9a141..8292f42 100644 --- a/cmd/ship/env/unset.go +++ b/cmd/ship/env/unset.go | |||
| @@ -18,6 +18,9 @@ var unsetCmd = &cobra.Command{ | |||
| 18 | 18 | ||
| 19 | func runUnset(cmd *cobra.Command, args []string) error { | 19 | func runUnset(cmd *cobra.Command, args []string) error { |
| 20 | name := args[0] | 20 | name := args[0] |
| 21 | if err := state.ValidateName(name); err != nil { | ||
| 22 | return err | ||
| 23 | } | ||
| 21 | keys := args[1:] | 24 | keys := args[1:] |
| 22 | 25 | ||
| 23 | st, err := state.Load() | 26 | st, err := state.Load() |
