(live: LiveShellRun, allowLastGood: boolean)
| 1167 | } |
| 1168 | |
| 1169 | private snapshotAtCut(live: LiveShellRun, allowLastGood: boolean): Promise<SnapshotAtCut> { |
| 1170 | if (live.mode === 'pipes') { |
| 1171 | const output = live.collector.snapshot(); |
| 1172 | if (live.driverExit?.mode === 'pipes') { |
| 1173 | output.stdoutTruncated ||= live.driverExit.value.stdoutTruncated; |
| 1174 | output.stderrTruncated ||= live.driverExit.value.stderrTruncated; |
| 1175 | } |
| 1176 | return Promise.resolve({ |
| 1177 | output, |
| 1178 | generation: live.collector.currentGeneration(), |
| 1179 | }); |
| 1180 | } |
| 1181 | const snapshot = live.collector.snapshotAtCut(); |
| 1182 | if (!allowLastGood) return snapshot; |
| 1183 | return snapshot.catch(() => ({ |
| 1184 | output: live.collector.lastGoodSnapshot(), |
| 1185 | generation: live.collector.currentGeneration(), |
| 1186 | })); |
| 1187 | } |
| 1188 | |
| 1189 | private onNativeRootExit(live: LiveShellRun): void { |
| 1190 | if (live.rootExited) return; |
no test coverage detected