Skip to content

Commit

Permalink
improvement(app), display the app list when running "bit app" without…
Browse files Browse the repository at this point in the history
… a subcommand (#9419)

Also, improve `AppNotFound` error message to suggests running "bit app
list".
  • Loading branch information
davidfirst authored Jan 7, 2025
1 parent 8008c3d commit dc625f4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions scopes/harmony/application/app.cmd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,18 @@ export class AppListCmd implements Command {
}

export class AppCmd implements Command {
name = 'app <sub-command>';
name = 'app [sub-command]';
description = 'Manages apps';
helpUrl = 'docs/getting-started/composing/create-apps';
alias = 'apps';
group = 'apps';
commands: Command[] = [];
options = [] as CommandOptions;

constructor(private applicationAspect: ApplicationMain) {}

// eslint-disable-next-line @typescript-eslint/no-unused-vars
async report(args: [string]) {
// it should never be here. Yargs throws an error before reaching this method.
return `Please specify a sub-command`;
return new AppListCmd(this.applicationAspect).report();
}
}
2 changes: 1 addition & 1 deletion scopes/harmony/application/application.main.runtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,7 @@ export class ApplicationMain {
harmony
);
appService.registerAppType = application.registerAppType.bind(application);
const appCmd = new AppCmd();
const appCmd = new AppCmd(application);
appCmd.commands = [new AppListCmd(application), new RunCmd(application, logger)];
aspectLoader.registerPlugins([new AppPlugin(appSlot)]);
builder.registerBuildTasks([new AppsBuildTask(application)]);
Expand Down

0 comments on commit dc625f4

Please sign in to comment.