Add rsvg-convert availability check in convertIconsToImages function to prevent errors when the command is not found
This commit is contained in:
parent
5c91d0f095
commit
cde4316e5d
|
|
@ -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]) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue