refactor: adjust code to updated dependencies

This commit is contained in:
Karl-Philipp Wulfert
2019-06-03 12:32:35 +02:00
parent 2ec80fbb2f
commit ce58450c54
9 changed files with 363 additions and 184 deletions

View File

@@ -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