🌳
pt0/serverF/fileutilsF/live1SpawnThrowF.mts
3import { ptDir } from '../ptDirF.mts'
5export const printSpawnFailContext = (_rett: {stdout: string, stderr: string}, _isQuiet?: boolean) => {
6 // Output already goes to stdout and ptnode captures full log
7 // No need for separate error context - ptnode prints log path at start
8}
10export const liveSpawnThrow = async (args: Parameters<typeof liveSpawn>[0]) => {
11 const rett = await liveSpawn(args)
12 const {cmd, printCmd, isQuiet} = args
13 if (!rett.isSuccess) {
14 printSpawnFailContext(rett, isQuiet)
15 throPtErr('!liveSpawnThrow', {cmd: (printCmd || cmd).replaceAll(`${ptDir}/`, '')}, rett)
16 }
17 return rett