Skip to content

Commit

Permalink
Merge pull request #535 from hazelops/IZE-703-ize-nvm-app-yarn-init-d…
Browse files Browse the repository at this point in the history
…oesnt-work

IZE-702 IZE-703 IZE-706 ize nvm bugs
  • Loading branch information
psihachina authored Nov 12, 2022
2 parents 4121eb3 + a67f13e commit 501eba9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
3 changes: 2 additions & 1 deletion internal/commands/ize.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ func Execute() {
}

func getConfig(cfg *config.Project) {
if slices.Contains(os.Args, "terraform") ||
if slices.Contains(os.Args, "terraform") ||
slices.Contains(os.Args, "nvm") ||
!(slices.Contains(os.Args, "aws-profile") ||
slices.Contains(os.Args, "doc") ||
slices.Contains(os.Args, "completion") ||
Expand Down
9 changes: 5 additions & 4 deletions internal/commands/nvm.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func NewCmdNvm(project *config.Project) *cobra.Command {
ValidArgsFunction: config.GetApps,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

if len(cmd.Flags().Args()) == 0 {
return fmt.Errorf("app name must be specified")
}

argsLenAtDash := cmd.ArgsLenAtDash()
err := o.Complete(cmd, args, argsLenAtDash)
if err != nil {
Expand Down Expand Up @@ -91,10 +96,6 @@ func (o *NvmOptions) Complete(cmd *cobra.Command, args []string, argsLenAtDash i
}

func (o *NvmOptions) Validate() error {
if len(o.AppName) == 0 {
return fmt.Errorf("can't validate options: app name must be specified")
}

if len(o.Command) == 0 {
return fmt.Errorf("can't validate: you must specify at least one command for the container")
}
Expand Down

0 comments on commit 501eba9

Please sign in to comment.