mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-19 08:02:55 +00:00
refactor: adjust code to updated dependencies
This commit is contained in:
12
src/cli.ts
12
src/cli.ts
@@ -22,17 +22,15 @@ import {remind} from './tasks/remind';
|
||||
import {tidy} from './tasks/tidy';
|
||||
import {unlabel} from './tasks/unlabel';
|
||||
|
||||
const logger = new Logger();
|
||||
|
||||
// add default handler for unhandled rejections
|
||||
process.on('unhandledRejection', (err) => {
|
||||
logger.error('UNHANDLED REJECTION', err.stack);
|
||||
Logger.error('UNHANDLED REJECTION', err.stack);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
// check that environment variable GITLAB_PRIVATE_TOKEN is set
|
||||
if (typeof process.env.GITLAB_PRIVATE_TOKEN !== 'string' || process.env.GITLAB_PRIVATE_TOKEN.length === 0) {
|
||||
logger.error('Environment variable GITLAB_PRIVATE_TOKEN is not set!');
|
||||
Logger.error('Environment variable GITLAB_PRIVATE_TOKEN is not set!');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
@@ -46,21 +44,21 @@ commander
|
||||
.command('unlabel')
|
||||
.action(async () => {
|
||||
await unlabel(gitlabApi);
|
||||
logger.ok('Done!');
|
||||
Logger.ok('Done!');
|
||||
});
|
||||
|
||||
commander
|
||||
.command('tidy')
|
||||
.action(async () => {
|
||||
await tidy(gitlabApi);
|
||||
logger.ok('Done!');
|
||||
Logger.ok('Done!');
|
||||
});
|
||||
|
||||
commander
|
||||
.command('remind')
|
||||
.action(async () => {
|
||||
await remind(gitlabApi);
|
||||
logger.ok('Done!');
|
||||
Logger.ok('Done!');
|
||||
});
|
||||
|
||||
commander
|
||||
|
||||
Reference in New Issue
Block a user