Skip to content

Commit 7865abf

Browse files
alan-agius4AndrewKushnir
authored andcommitted
build: fix api guardian path for windows (angular#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 angular#26888
1 parent efa443b commit 7865abf

File tree

1 file changed

+1
-1
lines changed
  • tools/ts-api-guardian/lib

1 file changed

+1
-1
lines changed

tools/ts-api-guardian/lib/cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function resolveBazelFilePath(fileName: string): string {
191191
// are not available in the working directory. In order to resolve the real path for the
192192
// runfile, we need to use `require.resolve` which handles runfiles properly on Windows.
193193
if (process.env['BAZEL_TARGET']) {
194-
return path.posix.relative(process.cwd(), require.resolve(fileName));
194+
return path.relative(process.cwd(), require.resolve(fileName));
195195
}
196196

197197
return fileName;

0 commit comments

Comments
 (0)