webapps/scripts/auxilary.mjs
Dominik Milacher 0dc24c4db7
Some checks failed
Build and deploy updated apps / Build & deploy (push) Failing after 50s
Extend ux layer and overhaul panoramablick-saalbach.at
2025-11-21 21:17:52 +01:00

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)
}
}
}