Skip to content

Commit e0d15c4

Browse files
authored
Merge pull request #4 from achew22/runfiles
Use find to search the runfiles for node.
2 parents a5bd476 + 99f4b57 commit e0d15c4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

node/internal/node_binary.bzl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ export PATH={node_bin_path}:$PATH
1212
# Used by NPM
1313
export NODE_PATH={node_paths}
1414
15-
# Run it
16-
"{node_bin}" "{script_path}" $@
15+
# Run it but wrap all calls to paths in a call to find. The call to find will
16+
# search recursively through the filesystem to find the appropriate runfiles
17+
# directory if that is necessary.
18+
exec $(find . | grep -m 1 "{node_bin}") $(find . | grep -m 1 "{script_path}") $@
1719
"""
1820

1921

@@ -62,8 +64,8 @@ def node_binary_impl(ctx):
6264
output = ctx.outputs.executable,
6365
executable = True,
6466
content = BASH_TEMPLATE.format(
65-
node_bin = node.short_path,
66-
script_path = script.short_path,
67+
node_bin = node.path,
68+
script_path = script.path,
6769
node_bin_path = node.dirname,
6870
node_paths = ":".join(node_paths),
6971
),

0 commit comments

Comments
 (0)