Skip to content

Commit

Permalink
add cancellation listener
Browse files Browse the repository at this point in the history
  • Loading branch information
thedonmon committed May 1, 2024
1 parent 1da5f0e commit 67e1f97
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ const warning = chalk.hex('#FFA500');
const magentaB = chalk.magentaBright;
const cliProgram = new Command();

process.on('SIGINT', () => {
const spinner = ora(
warning('Received SIGINT. Gracefully shutting down...'),
).start();
setTimeout(() => {
spinner.stop().info();
process.exit(0);
}, 1000);
});

cliProgram
.name('cnft-cli')
.description('CLI for CNFT Minting and Management')
Expand Down

0 comments on commit 67e1f97

Please sign in to comment.