mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-08 06:22:53 +00:00
refactor: explicitly instantiate commander
This commit is contained in:
@@ -16,7 +16,7 @@ import {Api} from '@openstapps/gitlab-api';
|
||||
import {Logger} from '@openstapps/logger';
|
||||
import {AddLogLevel} from '@openstapps/logger/lib/transformations/add-log-level';
|
||||
import {Colorize} from '@openstapps/logger/lib/transformations/colorize';
|
||||
import * as commander from 'commander';
|
||||
import {Command} from 'commander';
|
||||
import {existsSync, readFileSync} from 'fs';
|
||||
import {join, resolve} from 'path';
|
||||
import {cwd, stdout} from 'process';
|
||||
@@ -37,6 +37,9 @@ process.on('unhandledRejection', async (reason) => {
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// instantiate new commander
|
||||
const commander = new Command('openstapps-projectmanagement');
|
||||
|
||||
// error on unknown commands
|
||||
commander.on('command:*', async () => {
|
||||
await Logger.error('Invalid command: %s\nSee --help for a list of available commands.', commander.args.join(' '));
|
||||
|
||||
Reference in New Issue
Block a user