Some checks failed
Build and deploy updated apps / Build & deploy (push) Failing after 50s
22 lines
466 B
JavaScript
22 lines
466 B
JavaScript
import { execSync } from 'node:child_process'
|
|
|
|
export function run(command, exit = true) {
|
|
try {
|
|
return execSync(command, { stdio: 'pipe', encoding: 'utf8' })
|
|
} catch (e) {
|
|
console.error(`Command ${command} failed with status ${e.status}`)
|
|
|
|
if (e.stdout) {
|
|
console.error(`\nStandard output:\n${e.stdout}`)
|
|
}
|
|
|
|
if (e.stderr) {
|
|
console.error(`\nStandard error:\n${e.stderr}`)
|
|
}
|
|
|
|
if (exit) {
|
|
process.exit(2)
|
|
}
|
|
}
|
|
}
|