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.
This commit is contained in:
1 parent
c4a67297a7
commit
9971d2ae59
1 file changed
+7
-3
@@ -28,8 +28,10 @@ export function generateAssetsPlugin(isDev = false) {
|
|||||||
|
|
||||||
// Compile Legacy themes
|
// Compile Legacy themes
|
||||||
const themes = { Legacy: {}, V3: {} };
|
const themes = { Legacy: {}, V3: {} };
|
||||||
const legacyDirs = fs.readdirSync('./themes/Legacy');
|
const legacyDirs = fs.readdirSync('./themes/Legacy', { withFileTypes: true })
|
||||||
for (const dir of legacyDirs) {
|
.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'));
|
const themeData = JSON.parse(fs.readFileSync(`./themes/Legacy/${dir}/settings.json`, 'utf-8'));
|
||||||
themeData.path = dir;
|
themeData.path = dir;
|
||||||
themes.Legacy[dir] = themeData;
|
themes.Legacy[dir] = themeData;
|
||||||
@@ -41,7 +43,9 @@ export function generateAssetsPlugin(isDev = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Compile V3 themes
|
// 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) {
|
for (const dir of v3Dirs) {
|
||||||
const themeData = JSON.parse(fs.readFileSync(`./themes/V3/${dir}/settings.json`, 'utf-8'));
|
const themeData = JSON.parse(fs.readFileSync(`./themes/V3/${dir}/settings.json`, 'utf-8'));
|
||||||
themeData.path = dir;
|
themeData.path = dir;
|
||||||
|
|||||||
Reference in new issue
Block a user