This commit is contained in:
Brian Zalewski 2024-04-02 08:07:20 +00:00
parent f07bbaa8bc
commit fb7ee86627

View file

@ -42,8 +42,9 @@ async function runScript(key, script) {
fs.writeFileSync(`${cacheDir}/${key}`, templatedScript.stdout) fs.writeFileSync(`${cacheDir}/${key}`, templatedScript.stdout)
try { try {
runSilentCommand(`glow --width 140 "${cacheDir}/${key}-glow"`) runSilentCommand(`glow --width 140 "${cacheDir}/${key}-glow"`)
if (process.env.DEBUG) { // TODO: Set process.env.DEBUG || true here because the asynchronous method is not logging properly / running slow
runSilentCommand(`bash "${cacheDir}/${key}" || logg error 'Error occurred while processing script for ${key}'`) if (process.env.DEBUG || true) {
return runSilentCommand(`bash "${cacheDir}/${key}" || logg error 'Error occurred while processing script for ${key}'`)
} else { } else {
return $`bash "${cacheDir}/${key}" || logg error 'Error occurred while processing script for ${key}'`.pipe(process.stdout) return $`bash "${cacheDir}/${key}" || logg error 'Error occurred while processing script for ${key}'`.pipe(process.stdout)
} }