12 lines
385 B
JavaScript
12 lines
385 B
JavaScript
const { spawn } = require( 'child_process' );
|
|
const path = require( 'path' );
|
|
|
|
const electronBin = require( '../node_modules/electron' );
|
|
const appDir = path.join( __dirname, '..' );
|
|
|
|
const env = { ...process.env };
|
|
delete env.ELECTRON_RUN_AS_NODE;
|
|
|
|
const child = spawn( electronBin, [ appDir ], { stdio: 'inherit', env } );
|
|
child.on( 'close', ( code ) => process.exit( code ?? 0 ) );
|