Skip to content

Commit

Permalink
fix: registering self-environment
Browse files Browse the repository at this point in the history
  • Loading branch information
shibme committed Oct 2, 2024
1 parent 827d5fb commit 7778542
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 19 deletions.
1 change: 0 additions & 1 deletion internal/cli/commands/cmdenv/const.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ var (
envAddCmd *cobra.Command
envListSearchCmd *cobra.Command
envDeleteCmd *cobra.Command
envSetSCmd *cobra.Command
envSetSelfSCmd *cobra.Command
envShowCmd *cobra.Command
envShowRootCmd *cobra.Command
Expand Down
2 changes: 1 addition & 1 deletion internal/cli/commands/cmdenv/env.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func EnvCommand() *cobra.Command {
envCmd.AddCommand(envAddCommand())
envCmd.AddCommand(envListSearchCommand())
envCmd.AddCommand(envDeleteCommand())
envCmd.AddCommand(envSetCommand())
envCmd.AddCommand(envSetSelfCommand())
envCmd.AddCommand(envShowCommand())
return envCmd
}
18 changes: 1 addition & 17 deletions internal/cli/commands/cmdenv/set.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,12 @@ import (
"oss.amagi.com/slv/internal/core/input"
)

func envSetCommand() *cobra.Command {
if envSetSCmd != nil {
return envSetSCmd
}
envSetSCmd = &cobra.Command{
Use: "set",
Aliases: []string{"put", "update"},
Short: "Set/update an environments",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
}
envSetSCmd.AddCommand(envSetSelfCommand())
return envSetSCmd
}

func envSetSelfCommand() *cobra.Command {
if envSetSelfSCmd != nil {
return envSetSelfSCmd
}
envSetSelfSCmd = &cobra.Command{
Use: "set",
Use: "set-self",
Aliases: []string{"save", "put", "store", "s"},
Short: "Sets a given environment as self",
Run: func(cmd *cobra.Command, args []string) {
Expand Down

0 comments on commit 7778542

Please sign in to comment.