diff --git a/package.json b/package.json index 5be8e29..216e2b9 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/scripts/build-gui.js b/scripts/build-gui.js new file mode 100644 index 0000000..aafb7c7 --- /dev/null +++ b/scripts/build-gui.js @@ -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' + } +);