Skip to content

Commit

Permalink
feat: add entrypoints:list command
Browse files Browse the repository at this point in the history
  • Loading branch information
maksadbek committed Jun 27, 2024
1 parent c4c7e70 commit 6b4cb7d
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/Commands/GetEntryPoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Arguments, Argv, CommandModule } from 'yargs';
import { container } from 'tsyringe';

export class GetEntryPoints implements CommandModule {
public readonly command = 'get-entrypoints [options]';
public readonly command = 'entrypoints:list [options]';
public readonly describe = 'get all entrypoints of the project.';

public builder(argv: Argv): Argv {
Expand Down Expand Up @@ -48,10 +48,11 @@ export class GetEntryPoints implements CommandModule {

if (args.verbose) {
// eslint-disable-next-line no-console
console.log(entryPoints);
console.log('%j', entryPoints);
} else {
// eslint-disable-next-line no-console
console.log(
'%j',
entryPoints.map((entryPoint) => ({
id: entryPoint.id,
method: entryPoint.method,
Expand All @@ -60,10 +61,10 @@ export class GetEntryPoints implements CommandModule {
);
}

process.exit(0);
process.exitCode = 0;
} catch (e) {
logger.error(`Error during "get-entrypoints": ${e.error || e.message}`);
process.exit(1);
logger.error(`Error during "entrypoints:list": ${e.error || e.message}`);
process.exitCode = 1;
}
}
}

0 comments on commit 6b4cb7d

Please sign in to comment.