diff options
Diffstat (limited to 'lib/utils.ts')
-rw-r--r-- | lib/utils.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/utils.ts b/lib/utils.ts index 536c4d05a..db5e5c762 100644 --- a/lib/utils.ts +++ b/lib/utils.ts @@ -74,6 +74,20 @@ export function maskRootdir(filepath: string): string { } } +export function simplifyRootdirInArgs(filepath: string): string { + if (filepath) { + if (process.platform === 'win32') { + return filepath + .replace(/C:\/Users\/[\w\d-.]*\/AppData\/Local\/Temp\/compiler-explorer-compiler[\w\d-.]*\//, '/app/') + .replace(/C:\\Windows\\TEMP\\compiler-explorer-compiler[\w\d-.]*\\/, '/app/'); + } else { + return filepath.replace(/\/tmp\/compiler-explorer-compiler[\w\d-.]*\//, '/app/'); + } + } else { + return filepath; + } +} + const ansiColoursRe = /\x1B\[[\d;]*[Km]/g; function _parseOutputLine(line: string, inputFilename?: string, pathPrefix?: string) { |