From 7865abf667f3857fe8d0150c00d6bf0b37724cc3 Mon Sep 17 00:00:00 2001 From: Alan Agius Date: Thu, 1 Nov 2018 11:48:18 +0100 Subject: [PATCH] build: fix api guardian path for windows (#26888) At the moment, `path.posix.relative` will break paths in windows as it will return something like ``` Error: Source file "../C:/users/alag/_bazel_alag/3tbqurya/execroot/angular/bazel-out/x64_windows-fastbuild/bin/packages/core/core.d.ts" not found ``` PR Close #26888 --- tools/ts-api-guardian/lib/cli.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/ts-api-guardian/lib/cli.ts b/tools/ts-api-guardian/lib/cli.ts index 6c29c51cf8..b7aa665ead 100644 --- a/tools/ts-api-guardian/lib/cli.ts +++ b/tools/ts-api-guardian/lib/cli.ts @@ -191,7 +191,7 @@ function resolveBazelFilePath(fileName: string): string { // are not available in the working directory. In order to resolve the real path for the // runfile, we need to use `require.resolve` which handles runfiles properly on Windows. if (process.env['BAZEL_TARGET']) { - return path.posix.relative(process.cwd(), require.resolve(fileName)); + return path.relative(process.cwd(), require.resolve(fileName)); } return fileName;