diff --git a/src/utils/console.ts b/src/utils/console.ts index b4528ee..50e25f5 100644 --- a/src/utils/console.ts +++ b/src/utils/console.ts @@ -10,4 +10,7 @@ export const log = { link: (message: string, link: string) => { console.log(`\x1b]8;;${link}\x1b\\${message}\x1b]8;;\x1b\\`); }, + error: (message: string) => { + console.log(pc.red(message)); + }, }; diff --git a/src/utils/generateIcon.ts b/src/utils/generateIcon.ts index 5d4fccf..ef329f3 100644 --- a/src/utils/generateIcon.ts +++ b/src/utils/generateIcon.ts @@ -117,10 +117,15 @@ const saveIcons = async ( export const syncIcons = async (config: Config) => { const groupedIcons = groupIconsByPrefix(config.icons); - await Promise.all( + + await Promise.allSettled( groupedIcons.map(async ([prefix, icons]) => { - const data = await generateIconCode(prefix, icons, config.typescript); - await saveIcons(config.outputPath, data.filename, data.code); + try { + const data = await generateIconCode(prefix, icons, config.typescript); + await saveIcons(config.outputPath, data.filename, data.code); + } catch (error) { + log.error(`Not found ${prefix}`); + } }) ); };