mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-07-26 09:52:11 +03:00
24 lines
537 B
JavaScript
Executable File
24 lines
537 B
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
import { spawn } from 'node:child_process'
|
|
|
|
const env = { ...process.env }
|
|
|
|
await exec('npx next build --experimental-build-mode generate')
|
|
|
|
// launch application
|
|
await exec(process.argv.slice(2).join(' '))
|
|
|
|
function exec(command) {
|
|
const child = spawn(command, { shell: true, stdio: 'inherit', env })
|
|
return new Promise((resolve, reject) => {
|
|
child.on('exit', code => {
|
|
if (code === 0) {
|
|
resolve()
|
|
} else {
|
|
reject(new Error(`${command} failed rc=${code}`))
|
|
}
|
|
})
|
|
})
|
|
}
|