21 lines
567 B
JavaScript
21 lines
567 B
JavaScript
import { spawnSync } from 'node:child_process'
|
|
import { dirname, join } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
|
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
const desktopRoot = join(__dirname, '..')
|
|
const electronBin = join(
|
|
desktopRoot,
|
|
'node_modules/.bin',
|
|
process.platform === 'win32' ? 'electron.cmd' : 'electron',
|
|
)
|
|
|
|
const args = ['.', ...process.argv.slice(2)]
|
|
const result = spawnSync(electronBin, args, {
|
|
cwd: desktopRoot,
|
|
stdio: 'inherit',
|
|
shell: process.platform === 'win32',
|
|
})
|
|
|
|
process.exit(result.status ?? 1)
|