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
This commit is contained in:
Pete Bacon Darwin 2020-05-12 08:20:00 +01:00 committed by Kara Erickson
parent 7ebf35c5f8
commit a2b8dc1cfb
1 changed files with 1 additions and 1 deletions

View File

@ -78,7 +78,7 @@ export class LockFileWithChildProcess implements LockFile {
this.logger.level !== undefined ? this.logger.level.toString() : LogLevel.info.toString(); this.logger.level !== undefined ? this.logger.level.toString() : LogLevel.info.toString();
const isWindows = process.platform === 'win32'; const isWindows = process.platform === 'win32';
const unlocker = fork( const unlocker = fork(
this.fs.resolve(__dirname, './unlocker.js'), [path, logLevel], __dirname + '/unlocker.js', [path, logLevel],
{detached: true, stdio: isWindows ? 'pipe' : 'inherit'}); {detached: true, stdio: isWindows ? 'pipe' : 'inherit'});
if (isWindows) { if (isWindows) {
unlocker.stdout?.on('data', process.stdout.write.bind(process.stdout)); unlocker.stdout?.on('data', process.stdout.write.bind(process.stdout));