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();
|
||||
|
||||
@@ -17,6 +17,14 @@ const __dirname = getDirnameFromImportMeta(import.meta.url);
|
||||
const rootDirectory = path.resolve(__dirname, '..');
|
||||
const svgFilesDirectory = path.resolve(rootDirectory, 'icons');
|
||||
|
||||
// Ctrl+C to abort
|
||||
process.stdin.on('data', (key) => {
|
||||
if (key.toString() === '\u0003') {
|
||||
process.stdout.write('Aborted\n');
|
||||
process.exit(1);
|
||||
}
|
||||
});
|
||||
|
||||
const iconsData = await getIconsData();
|
||||
const icons = iconsData.map((icon, index) => {
|
||||
const slug = getIconSlug(icon);
|
||||
|
||||
Reference in New Issue
Block a user