File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -184,6 +184,14 @@ diff_test(
184184 target_compatible_with = not_windows ,
185185)
186186
187+ genrule (
188+ name = "npm_help" ,
189+ outs = ["help.txt" ],
190+ cmd = "$(NPM_PATH) --help > $@ || true" ,
191+ toolchains = ["@nodejs_toolchains//:resolved_toolchain" ],
192+ tools = ["@nodejs_toolchains//:resolved_toolchain" ],
193+ )
194+
187195################################################
188196# Tests and setup for the toolchain changes
189197
Original file line number Diff line number Diff line change @@ -83,9 +83,10 @@ def _nodejs_toolchain_impl(ctx):
8383 "NODE_PATH" : ctx .file .node .path if ctx .attr .node else ctx .attr .node_path ,
8484 "NPM_PATH" : ctx .file .npm .path if ctx .attr .npm else ctx .attr .npm_path ,
8585 })
86+ files = [f for f in [ctx .file .node , ctx .file .npm ] if f ]
8687 default = DefaultInfo (
87- files = depset ([ ctx . file . node ]) if ctx . attr . node else depset ( ),
88- runfiles = ctx .runfiles (files = [ ctx . file . node ] if ctx . attr . node else [] ),
88+ files = depset (files ),
89+ runfiles = ctx .runfiles (files = files ),
8990 )
9091 npm_sources = depset ([ctx .file .npm ] + ctx .files .npm_srcs )
9192 nodeinfo = NodeInfo (
You can’t perform that action at this time.
0 commit comments