Add rsvg-convert availability check in convertIconsToImages function to prevent errors when the command is not found

This commit is contained in:
codecalm 2025-12-26 17:23:50 +01:00
parent 5c91d0f095
commit cde4316e5d
1 changed files with 11 additions and 0 deletions

View File

@ -553,6 +553,17 @@ export const getCompileOptions = () => {
};
export const convertIconsToImages = async (dir, extension, size = 240) => {
const rsvgConvertAvailable = await new Promise((resolve) => {
exec('command -v rsvg-convert', (error) => {
resolve(!error);
});
});
if (!rsvgConvertAvailable) {
console.log(`\nWarning: rsvg-convert not found. Skipping ${extension} conversion.`);
return;
}
const icons = getAllIcons();
await asyncForEach(Object.entries(icons), async function ([type, svgFiles]) {