You've already forked simple-icons
mirror of
https://github.com/simple-icons/simple-icons.git
synced 2025-11-23 21:34:49 +02:00
Catch Ctrl+C keys to abort execution in scripts (#12852)
This commit is contained in:
committed by
GitHub
parent
f4ac11daca
commit
4a368d8ef5
@@ -28,6 +28,14 @@ import {
|
||||
writeIconsData,
|
||||
} from './utils.js';
|
||||
|
||||
// Ctrl+C to abort
|
||||
process.stdin.on('data', (key) => {
|
||||
if (key.toString() === '\u0003') {
|
||||
process.stdout.write('Aborted\n');
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
/** @type {import('../sdk.js').IconData[]} */
|
||||
const iconsData = JSON.parse(await getIconsDataString());
|
||||
const jsonSchema = await getJsonSchemaData();
|
||||
|
||||
Reference in New Issue
Block a user