mirror of
https://github.com/scratchfoundation/scratch-desktop.git
synced 2024-12-22 21:52:31 -05:00
25 lines
591 B
JavaScript
25 lines
591 B
JavaScript
const childProcess = require('child_process');
|
|
const path = require('path');
|
|
|
|
// process.argv: ['node', 'run-in-gui.js', 'foo', ...]
|
|
const args = process.argv.slice(2);
|
|
|
|
// copy environment (including PATH) then add or replace BUILD_MODE and STATIC_PATH
|
|
const env = {
|
|
...process.env,
|
|
BUILD_MODE: 'dist',
|
|
STATIC_PATH: 'static'
|
|
};
|
|
|
|
const child = childProcess.spawnSync(
|
|
'npm', args,
|
|
{
|
|
cwd: path.join('node_modules', 'scratch-gui'),
|
|
env,
|
|
shell: true,
|
|
stdio: 'inherit'
|
|
}
|
|
);
|
|
|
|
if (child.error) throw child.error;
|
|
process.exit(child.status);
|