mirror of
https://github.com/Boof2015/prism.git
synced 2026-08-16 00:00:31 +02:00
18 lines
484 B
JavaScript
18 lines
484 B
JavaScript
const { spawnSync } = require('node:child_process')
|
|
|
|
const scriptByPlatform = {
|
|
darwin: 'dist:mac',
|
|
linux: 'dist:linux',
|
|
win32: 'dist:win',
|
|
}
|
|
|
|
const script = scriptByPlatform[process.platform]
|
|
if (!script) {
|
|
console.error(`Packaging is not configured for ${process.platform}.`)
|
|
process.exit(1)
|
|
}
|
|
|
|
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
|
const result = spawnSync(npmCommand, ['run', script], { stdio: 'inherit' })
|
|
process.exit(result.status ?? 1)
|