Skip to content

Commit

Permalink
fix(builtin): locations arg of npm_package_bin should result in separ…
Browse files Browse the repository at this point in the history
…ate argv
  • Loading branch information
alexeagle committed Nov 26, 2019
1 parent 4bacc48 commit 242379f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
14 changes: 6 additions & 8 deletions examples/app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,13 @@ load("@npm_bazel_typescript//:index.bzl", "ts_devserver", "ts_library")

package(default_visibility = ["//visibility:public"])

_ASSETS = [
":bundle.min",
"//styles:base.css",
"//styles:test.css",
]

ts_library(
name = "app",
srcs = ["app.ts"],
)

ts_devserver(
name = "devserver",
static_files = [":inject_tags"] + _ASSETS,
# We'll collect all the devmode JS sources from these TypeScript libraries
deps = [":app"],
)
Expand All @@ -38,6 +31,12 @@ terser_minified(
src = ":bundle",
)

_ASSETS = [
":bundle.min",
"//styles:base.css",
"//styles:test.css",
]

# Copy index.html to the output folder, adding <script> and <link> tags
html_insert_assets(
name = "inject_tags",
Expand All @@ -49,7 +48,6 @@ html_insert_assets(
"$(location :index.tmpl.html)",
"--roots",
"$@",
] + [
"--assets",
] + ["$(locations %s)" % a for a in _ASSETS],
data = [":index.tmpl.html"] + _ASSETS,
Expand Down
5 changes: 4 additions & 1 deletion internal/node/npm_package_bin.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ def _impl(ctx):
outputs = ctx.outputs.outs

for a in ctx.attr.args:
args.add(_expand_location(ctx, a))
# Workaround bazelbuild/bazel#10309
# If one of the files has a space in the name, we will
# incorrectly split it into multiple argv
args.add_all(_expand_location(ctx, a).split(" "))
run_node(
ctx,
executable = "tool",
Expand Down

0 comments on commit 242379f

Please sign in to comment.