make build-gui script work on all platforms

This commit is contained in:
Christopher Willis-Ford 2019-06-24 11:35:12 -07:00
parent 48964e616e
commit d79811d842
2 changed files with 16 additions and 1 deletions

View file

@ -7,7 +7,7 @@
"license": "BSD-3-Clause",
"scripts": {
"start": "electron-webpack dev --bail --display-error-details --env.minify=false",
"build-gui": "cd ./node_modules/scratch-gui && BUILD_MODE=dist STATIC_PATH=static npm run build",
"build-gui": "node ./scripts/build-gui.js",
"clean": "rimraf ./dist/ ./static/assets/",
"compile": "rimraf ./dist/ && electron-webpack --bail --display-error-details --env.minify=false",
"fetch": "rimraf ./static/assets/ && mkdirp ./static/assets/ && node ./scripts/fetchMediaLibraryAssets.js",

15
scripts/build-gui.js Normal file
View file

@ -0,0 +1,15 @@
const childProcess = require('child_process');
const path = require('path');
childProcess.spawnSync(
'npm', ['run', 'build'],
{
cwd: path.join('node_modules', 'scratch-gui'),
env: {
BUILD_MODE: 'dist',
STATIC_PATH: 'static'
},
shell: true,
stdio: 'inherit'
}
);