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:
@@ -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//
|
||||
|
||||
|
||||
Reference in New Issue
Block a user