Skip to content

Commit

Permalink
fix: allSettled
Browse files Browse the repository at this point in the history
  • Loading branch information
gronxb committed Sep 14, 2024
1 parent c214c3d commit f3fa74f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/utils/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
},
};
11 changes: 8 additions & 3 deletions src/utils/generateIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`);
}
})
);
};

0 comments on commit f3fa74f

Please sign in to comment.