Skip to content

Commit

Permalink
refactor: only attach new command if there's generate commands
Browse files Browse the repository at this point in the history
  • Loading branch information
the-avid-engineer committed Jul 25, 2024
1 parent ed362c6 commit f0d8303
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/InfrastructureCli/Commands/ProgramCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ public ProgramCommand(ProgramCommandOptions options)
var rootCommand = new RootCommand();

InteractiveCommand.Attach(rootCommand);
NewCommand.Attach(rootCommand, options.GenerateCommands);
CanDeployCommand.Attach(rootCommand);
DeployCommand.Attach(rootCommand, options.ValidateConfigurationsFile);
GetCommand.Attach(rootCommand);

if (options.GenerateCommands is { Length: > 0 })
{
NewCommand.Attach(rootCommand, options.GenerateCommands);
}

_rootCommand = rootCommand;
}

Expand Down

0 comments on commit f0d8303

Please sign in to comment.