UNPKG

quality-bot

Version:

QBot Online Code Review Application

43 lines (35 loc) 1.09 kB
#!/usr/bin/env node 'use strict'; const commonService = require('./service/common-service'); const configureService = require('./service/configure-service'); const messageService = require('./service/message-service'); const handleExit = () => { console.log('Exiting without error.'); process.exit(); }; const handleError = e => { console.error('ERROR! An error was encountered while executing'); console.error(e); console.log('Exiting with error.'); process.exit(1); }; process.on('SIGINT', handleExit); process.on('uncaughtException', handleError); const start = async () => { const data = await commonService.parseData(); switch (data.command) { case 'review': case 'review-dev': await messageService.welcome(); await commonService.review(data); break; case 'configure': case 'configure-dev': await messageService.welcome(true); await configureService.configure(); break; default: messageService.helpMessage(); } } start();