(
yamlText: string,
currentFileDir: string,
moduleTargetByOriginalPath: Map<string, string>,
)
| 125 | } |
| 126 | |
| 127 | function rewriteModuleRefsForUiRun( |
| 128 | yamlText: string, |
| 129 | currentFileDir: string, |
| 130 | moduleTargetByOriginalPath: Map<string, string>, |
| 131 | ): string { |
| 132 | return yamlText.replace( |
| 133 | /^(\s*module\s*:\s*)(?:(["'])([^"'\n]+)\2|([^#\n][^\n#]*?))(\s*(?:#.*)?)$/gm, |
| 134 | (full, prefix: string, quoted: string | undefined, quotedPath: string | undefined, barePath: string | undefined, suffix: string | undefined) => { |
| 135 | const originalPath = (quotedPath ?? barePath ?? '').trim() |
| 136 | const targetPath = moduleTargetByOriginalPath.get(originalPath) |
| 137 | if (!targetPath) return full |
| 138 | const nextPath = toPosixRelative(currentFileDir, targetPath) |
| 139 | if (quoted) return `${prefix}${quoted}${nextPath}${quoted}${suffix ?? ''}` |
| 140 | return `${prefix}${nextPath}${suffix ?? ''}` |
| 141 | } |
| 142 | ) |
| 143 | } |
| 144 | |
| 145 | function eventLogPathForRun(projectRoot: string, run: RunInfo): string | null { |
| 146 | try { |
no test coverage detected