From d567d0727c5ee72376ead5b7aa0195187a8d8381 Mon Sep 17 00:00:00 2001 From: Daniel Smith Date: Sat, 4 May 2019 21:53:39 -0400 Subject: Add Gulp for live theme editing Run `npm start` from terminal to launch an extension host window and start watching the TypeScript source files. You can still open VS Code and press F5 if using a version older than 1.30 (January 2019). --- generate.js | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 generate.js (limited to 'generate.js') diff --git a/generate.js b/generate.js deleted file mode 100644 index 6f7a867..0000000 --- a/generate.js +++ /dev/null @@ -1,48 +0,0 @@ -var glob = require('glob'); -var fs = require('fs'); -var path = require('path'); -var childProcess = require('child_process'); - -// Run compiled theme generators -glob.sync('./themes/ts-built/**/*.js').forEach(function(file) { - childProcess.spawnSync('node', [ path.resolve(file) ]); -}); - -// Move generated themes to the correct folders -glob.sync('./themes/ts-built/dark/*.json').forEach(function(file) { - fs.renameSync(file, path.join(__dirname, 'themes', 'dark', path.basename(file))); -}); - -glob.sync('./themes/ts-built/light/*.json').forEach(function(file) { - fs.renameSync(file, path.join(__dirname, 'themes', 'light', path.basename(file))); -}); - -// Populate the "contributes" property in package.json -var themes = []; - -glob.sync('./themes/dark/*.json').forEach(function(file) { - var theme = require(file); - themes.push({ - label: theme.name, - uiTheme: 'vs-dark', - path: file - }); -}); - -glob.sync('./themes/light/*.json').forEach(function(file) { - var theme = require(file); - themes.push({ - label: theme.name, - uiTheme: 'vs', - path: file - }); -}); - -var package = require('./package.json'); - -package.contributes.themes = themes; - -fs.writeFile('./package.json', JSON.stringify(package, null, 2), function(err) { - if (err) return console.log(err); - console.log('package.json updated'); -}); \ No newline at end of file -- cgit v1.2.3