(filepath: string)
| 104 | * note: will keep /app/ if instead of filepath something like '-I/tmp/path' is used |
| 105 | */ |
| 106 | export function maskRootdir(filepath: string): string { |
| 107 | if (filepath) { |
| 108 | if (process.platform === 'win32') { |
| 109 | // todo: should also use temp_prefix here |
| 110 | return filepath |
| 111 | .replace(/^C:\/Users\/[\w\d-.]*\/AppData\/Local\/Temp\/compiler-explorer-compiler[\w\d-.]*\//, '/app/') |
| 112 | .replace(/^\/app\//, ''); |
| 113 | } |
| 114 | const re = getRegexForTempdir(); |
| 115 | return filepath.replace(re, '/app/').replace(/^\/app\//, ''); |
| 116 | } |
| 117 | return filepath; |
| 118 | } |
| 119 | |
| 120 | export function changeExtension(filename: string, newExtension: string): string { |
| 121 | const lastDot = filename.lastIndexOf('.'); |
no test coverage detected