Skip to content

Commit

Permalink
build(bazel): Fix npm install on windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukas Holzer authored and lukasholzer committed Sep 8, 2020
1 parent fbe43c3 commit e85bcb0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions WORKSPACE
Expand Up @@ -25,6 +25,9 @@ http_archive(
name = "build_bazel_rules_nodejs",
sha256 = RULES_NODEJS_SHA256,
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/%s/rules_nodejs-%s.tar.gz" % (RULES_NODEJS_VERSION, RULES_NODEJS_VERSION),
patches = [
"//:rules_nodejs-npm-install+2.0.3.patch",
]
)

http_archive(
Expand Down Expand Up @@ -56,6 +59,7 @@ npm_install(
],
package_json = "//:package.json",
package_lock_json = "//:package-lock.json",
quiet = False,
symlink_node_modules = True,
)

Expand Down
13 changes: 13 additions & 0 deletions rules_nodejs-npm-install+2.0.3.patch
@@ -0,0 +1,13 @@
diff --git internal/npm_install/npm_install.bzl internal/npm_install/npm_install.bzl
index 7bbe1297..9dfb51c3 100644
--- internal/npm_install/npm_install.bzl
+++ internal/npm_install/npm_install.bzl
@@ -225,7 +225,7 @@ set -e
repository_ctx.file(
"_npm.cmd",
content = """@echo off
-cd /D "{root}" && "{npm}" {npm_args}
+cd /D "{root}" && npm {npm_args}
""".format(
root = root,
npm = repository_ctx.path(npm),

0 comments on commit e85bcb0

Please sign in to comment.