0
0
mirror of https://github.com/naturalcrit/homebrewery.git synced 2025-12-24 20:42:43 +00:00

Compile list of available themes during build

This commit is contained in:
G.Ambatte
2023-04-02 15:17:30 +12:00
parent b2546d908a
commit da6fcb297a
2 changed files with 82 additions and 0 deletions

View File

@@ -101,7 +101,21 @@ fs.emptyDirSync('./build');
//v==---------------------------MOVE CM EDITOR THEMES -----------------------------==v//
editorThemeFiles = fs.readdirSync('./node_modules/codemirror/theme');
const editorThemeFile = './themes/codeMirror/editorThemes.json';
if(fs.existsSync(editorThemeFile)) fs.rmSync(editorThemeFile);
const stream = fs.createWriteStream(editorThemeFile, { flags: 'a' });
stream.write('[\n');
for (themeFile of editorThemeFiles) {
stream.write(`"${themeFile.slice(0, -4)}",\n`);
}
stream.write('"default"\n]\n');
stream.end();
await fs.copy('./node_modules/codemirror/theme', './build/homebrew/cm-themes');
// await fs.copy('./themes/codeMirror', './build/themes/codeMirror');
//v==----------------------------- BUNDLE PACKAGES --------------------------------==v//