Skip to content

Commit

Permalink
fix(npm_install) Add /D to all cmd CD calls, this makes CD change dri…
Browse files Browse the repository at this point in the history
…ve as well as directory.

Closes #1641
  • Loading branch information
KrauseStefan authored and alexeagle committed Mar 3, 2020
1 parent a80fe68 commit d9cbb99
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/node/node_repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
4 changes: 2 additions & 2 deletions internal/npm_install/npm_install.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit d9cbb99

Please sign in to comment.