mirror of
https://github.com/renovatebot/renovate.git
synced 2025-01-11 05:39:10 +00:00
27 lines
735 B
TypeScript
27 lines
735 B
TypeScript
import { ERROR } from 'bunyan';
|
|
import { getProblems, logger } from '../lib/logger';
|
|
import { generateSchema } from './docs/schema';
|
|
|
|
process.on('unhandledRejection', (err) => {
|
|
// Will print "unhandledRejection err is not defined"
|
|
logger.error({ err }, 'unhandledRejection');
|
|
process.exit(-1);
|
|
});
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
(async () => {
|
|
try {
|
|
const dist = '.';
|
|
|
|
// json-schema
|
|
logger.info('Generating json-schema');
|
|
await generateSchema(dist);
|
|
} catch (err) {
|
|
logger.error({ err }, 'Unexpected error');
|
|
} finally {
|
|
const loggerErrors = getProblems().filter((p) => p.level >= ERROR);
|
|
if (loggerErrors.length) {
|
|
process.exit(1);
|
|
}
|
|
}
|
|
})();
|