From 9971d2ae5905de406daf4e562bdcea9c720d1846 Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 27 Oct 2026 15:12:02 +1100 Subject: [PATCH] walk directories only MacOS will sometimes drop a `.DS_Store` file into these folders, and then the build fails with /themes/Legacy/.DS_Store/settings.json is not a valid path. --- vitePlugins/generateAssetsPlugin.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/vitePlugins/generateAssetsPlugin.js b/vitePlugins/generateAssetsPlugin.js index 7eef8bda5..0cd31d162 100644 --- a/vitePlugins/generateAssetsPlugin.js +++ b/vitePlugins/generateAssetsPlugin.js @@ -28,8 +28,10 @@ export function generateAssetsPlugin(isDev = false) { // Compile Legacy themes const themes = { Legacy: {}, V3: {} }; - const legacyDirs = fs.readdirSync('./themes/Legacy'); - for (const dir of legacyDirs) { + const legacyDirs = fs.readdirSync('./themes/Legacy', { withFileTypes: true }) + .filter(entry => entry.isDirectory()) + .map(entry => entry.name); + for (const dir of legacyDirs) { const themeData = JSON.parse(fs.readFileSync(`./themes/Legacy/${dir}/settings.json`, 'utf-8')); themeData.path = dir; themes.Legacy[dir] = themeData; @@ -41,7 +43,9 @@ export function generateAssetsPlugin(isDev = false) { } // Compile V3 themes - const v3Dirs = fs.readdirSync('./themes/V3'); + const v3Dirs = fs.readdirSync('./themes/V3', { withFileTypes: true }) + .filter(entry => entry.isDirectory()) + .map(entry => entry.name); for (const dir of v3Dirs) { const themeData = JSON.parse(fs.readFileSync(`./themes/V3/${dir}/settings.json`, 'utf-8')); themeData.path = dir;