(toolName: string)
| 17 | } |
| 18 | |
| 19 | export function createDefaultResultBundlePath(toolName: string): string { |
| 20 | const resultBundleDir = getWorkspaceFilesystemLayout(resolveWorkspaceKey()).resultBundles; |
| 21 | |
| 22 | try { |
| 23 | fs.mkdirSync(resultBundleDir, { recursive: true, mode: 0o700 }); |
| 24 | fs.accessSync(resultBundleDir, fs.constants.W_OK); |
| 25 | } catch (error) { |
| 26 | const message = error instanceof Error ? error.message : String(error); |
| 27 | throw new Error( |
| 28 | `Unable to create writable result bundle directory at ${resultBundleDir}: ${message}`, |
| 29 | ); |
| 30 | } |
| 31 | |
| 32 | return path.join( |
| 33 | resultBundleDir, |
| 34 | `${toolName}_${formatLogTimestamp()}_pid${process.pid}_${shortRandomSuffix()}.xcresult`, |
| 35 | ); |
| 36 | } |
| 37 | |
| 38 | export function markResultBundlePathCompleted(resultBundlePath: string | undefined): void { |
| 39 | if (!resultBundlePath) { |
no test coverage detected