@socketsupply/socket-linux-x64
Version:
A Cross-Platform, Native Runtime for Desktop and Mobile Apps — Create apps using HTML, CSS, and JavaScript. Written from the ground up to be small and maintainable.
38 lines (29 loc) • 646 B
JavaScript
import installation from '../src/index.js'
import { spawn } from 'node:child_process'
let exiting = false
const child = spawn(installation.bin.ssc, process.argv.slice(2), {
env: { ...installation.env, ...process.env },
stdio: 'inherit',
windowsHide: true
})
child.once('exit', (code) => {
if (!exiting) {
exiting = true
process.exit(code)
}
})
child.once('error', (err) => {
console.error(err.message)
if (!exiting) {
process.exit(1)
exiting = true
}
})
process.on('SIGTERM', () => {
child.kill('SIGTERM')
})
process.on('exit', () => {
child.kill('SIGTERM')
})
export default child