From a2b8dc1cfb169c2a2841b384e1c1acc861093d48 Mon Sep 17 00:00:00 2001 From: Pete Bacon Darwin Date: Tue, 12 May 2020 08:20:00 +0100 Subject: [PATCH] refactor(ngcc): ensure unlocker process works in mock file-systems (#36989) Previously the path to the unlocker process was being resolved by the current file-system. In the case that this was a `MockFileSystemWindows` on a non-Windows operating system, this resulted in an incorrect path to the entry-point. Now the path to the entry-point is hand-crafted to avoid being broken by whatever FileSystem is in use. PR Close #36989 --- .../ngcc/src/locking/lock_file_with_child_process/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts b/packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts index ba2aaf487a..20d4d3bee1 100644 --- a/packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts +++ b/packages/compiler-cli/ngcc/src/locking/lock_file_with_child_process/index.ts @@ -78,7 +78,7 @@ export class LockFileWithChildProcess implements LockFile { this.logger.level !== undefined ? this.logger.level.toString() : LogLevel.info.toString(); const isWindows = process.platform === 'win32'; const unlocker = fork( - this.fs.resolve(__dirname, './unlocker.js'), [path, logLevel], + __dirname + '/unlocker.js', [path, logLevel], {detached: true, stdio: isWindows ? 'pipe' : 'inherit'}); if (isWindows) { unlocker.stdout?.on('data', process.stdout.write.bind(process.stdout));