diff --git a/internal/node/node_repositories.bzl b/internal/node/node_repositories.bzl index b751d0425f..972e491166 100644 --- a/internal/node/node_repositories.bzl +++ b/internal/node/node_repositories.bzl @@ -509,7 +509,7 @@ SET SCRIPT_DIR=%~dp0 """ + "".join([ """ echo Running npm %* in {root} -cd "{root}" +cd /D "{root}" CALL "%SCRIPT_DIR%\\{node}" "%SCRIPT_DIR%\\{script}" --scripts-prepend-node-path=false %* if %errorlevel% neq 0 exit /b %errorlevel% """.format( @@ -595,7 +595,7 @@ SET SCRIPT_DIR=%~dp0 """ echo Running yarn %* in {root} SET "YARN_IGNORE_PATH=" -cd "{root}" +cd /D "{root}" CALL "%SCRIPT_DIR%\\{node}" "%SCRIPT_DIR%\\{script}" %* if %errorlevel% neq 0 exit /b %errorlevel% """.format( diff --git a/internal/npm_install/npm_install.bzl b/internal/npm_install/npm_install.bzl index 4958e9d932..4f0e9191f4 100644 --- a/internal/npm_install/npm_install.bzl +++ b/internal/npm_install/npm_install.bzl @@ -245,7 +245,7 @@ set -e repository_ctx.file( "_npm.cmd", content = """@echo off -cd "{root}" && "{npm}" {npm_args} +cd /D "{root}" && "{npm}" {npm_args} """.format( root = root, npm = repository_ctx.path(npm), @@ -382,7 +382,7 @@ unset YARN_IGNORE_PATH "_yarn.cmd", content = """@echo off set "YARN_IGNORE_PATH=" -cd "{root}" && "{yarn}" {yarn_args} +cd /D "{root}" && "{yarn}" {yarn_args} """.format( root = root, yarn = repository_ctx.path(yarn),