improve scripts/build-gui.js error reporting, compatibility

This commit is contained in:
Christopher Willis-Ford 2019-06-24 12:41:25 -07:00
parent 25597be1f8
commit 7b13482bc6

View file

@ -1,11 +1,12 @@
const childProcess = require('child_process'); const childProcess = require('child_process');
const path = require('path'); const path = require('path');
childProcess.spawnSync( const child = childProcess.spawnSync(
'npm', ['run', 'build'], 'npm', ['run', 'build'],
{ {
cwd: path.join('node_modules', 'scratch-gui'), cwd: path.join('node_modules', 'scratch-gui'),
env: { env: {
...process.env,
BUILD_MODE: 'dist', BUILD_MODE: 'dist',
STATIC_PATH: 'static' STATIC_PATH: 'static'
}, },
@ -13,3 +14,6 @@ childProcess.spawnSync(
stdio: 'inherit' stdio: 'inherit'
} }
); );
if (child.error) throw child.error;
process.exit(child.status);