Spaces:
Runtime error
Runtime error
File size: 568 Bytes
ad79323 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | #!/usr/bin/env node
const { spawn } = require('node:child_process')
const env = { ...process.env }
;(async() => {
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}`))
}
})
})
}
|