From cde4316e5d768ffe65fabc970696a95414e98387 Mon Sep 17 00:00:00 2001 From: codecalm Date: Fri, 26 Dec 2025 17:23:50 +0100 Subject: [PATCH] Add rsvg-convert availability check in convertIconsToImages function to prevent errors when the command is not found --- .build/helpers.mjs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.build/helpers.mjs b/.build/helpers.mjs index 6f2c08bd1..0a0d3155d 100644 --- a/.build/helpers.mjs +++ b/.build/helpers.mjs @@ -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]) {