fix(cli): exit cleanly when quitting out of CLI
This commit is contained in:
parent
862c8e1c7f
commit
8890f7dcfc
4 changed files with 18 additions and 3 deletions
|
@ -6,6 +6,10 @@ import figlet from 'figlet';
|
|||
import { initConfig, loadConfig } from '../lib/config.js';
|
||||
import { downloadAsset } from '../lib/download.js';
|
||||
import { runRootScript } from '../lib/runScript.js';
|
||||
import { handleExitError } from '../lib/handlers.js';
|
||||
|
||||
process.on('unhandledRejection', (err) => handleExitError(err, 'Unhandled rejection'));
|
||||
process.on('uncaughtException', (err) => handleExitError(err, 'Uncaught exception'));
|
||||
|
||||
program.name('coryd').description('🪄 Run commands, download things and have fun.').version('1.0.0');
|
||||
program.command('init').description('Initialize CLI and populate required config.').action(initConfig);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue