mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-20 08:33:11 +00:00
refactor: adjust code to updated dependencies
This commit is contained in:
@@ -23,13 +23,14 @@ import {tidy} from './tasks/tidy';
|
||||
import {unlabel} from './tasks/unlabel';
|
||||
|
||||
// add default handler for unhandled rejections
|
||||
process.on('unhandledRejection', (err) => {
|
||||
Logger.error('UNHANDLED REJECTION', err.stack);
|
||||
process.on('unhandledRejection', async (err) => {
|
||||
await 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) {
|
||||
// tslint:disable-next-line:no-floating-promises
|
||||
Logger.error('Environment variable GITLAB_PRIVATE_TOKEN is not set!');
|
||||
process.exit(1);
|
||||
}
|
||||
@@ -37,7 +38,8 @@ if (typeof process.env.GITLAB_PRIVATE_TOKEN !== 'string' || process.env.GITLAB_P
|
||||
const gitlabApi = new Api(GITLAB_API_URL, process.env.GITLAB_PRIVATE_TOKEN as string);
|
||||
|
||||
if (existsSync(join(__dirname, 'package.json'))) {
|
||||
commander.version(JSON.parse(readFileSync(join(__dirname, '..', 'package.json')).toString()).version);
|
||||
commander.version(JSON.parse(readFileSync(join(__dirname, '..', 'package.json'))
|
||||
.toString()).version);
|
||||
}
|
||||
|
||||
commander
|
||||
|
||||
Reference in New Issue
Block a user