Skip to content

Commit d9cbb99

Browse files
KrauseStefanalexeagle
authored andcommitted
fix(npm_install) Add /D to all cmd CD calls, this makes CD change drive as well as directory.
Closes #1641
1 parent a80fe68 commit d9cbb99

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

internal/node/node_repositories.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ SET SCRIPT_DIR=%~dp0
509509
""" + "".join([
510510
"""
511511
echo Running npm %* in {root}
512-
cd "{root}"
512+
cd /D "{root}"
513513
CALL "%SCRIPT_DIR%\\{node}" "%SCRIPT_DIR%\\{script}" --scripts-prepend-node-path=false %*
514514
if %errorlevel% neq 0 exit /b %errorlevel%
515515
""".format(
@@ -595,7 +595,7 @@ SET SCRIPT_DIR=%~dp0
595595
"""
596596
echo Running yarn %* in {root}
597597
SET "YARN_IGNORE_PATH="
598-
cd "{root}"
598+
cd /D "{root}"
599599
CALL "%SCRIPT_DIR%\\{node}" "%SCRIPT_DIR%\\{script}" %*
600600
if %errorlevel% neq 0 exit /b %errorlevel%
601601
""".format(

internal/npm_install/npm_install.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ set -e
245245
repository_ctx.file(
246246
"_npm.cmd",
247247
content = """@echo off
248-
cd "{root}" && "{npm}" {npm_args}
248+
cd /D "{root}" && "{npm}" {npm_args}
249249
""".format(
250250
root = root,
251251
npm = repository_ctx.path(npm),
@@ -382,7 +382,7 @@ unset YARN_IGNORE_PATH
382382
"_yarn.cmd",
383383
content = """@echo off
384384
set "YARN_IGNORE_PATH="
385-
cd "{root}" && "{yarn}" {yarn_args}
385+
cd /D "{root}" && "{yarn}" {yarn_args}
386386
""".format(
387387
root = root,
388388
yarn = repository_ctx.path(yarn),

0 commit comments

Comments
 (0)