Skip to content

Commit

Permalink
fix(builtin): don't include external files when pkg_npm is in root pa…
Browse files Browse the repository at this point in the history
…ckage

This logic assumed that package_path was non-empty, but when a pkg_npm rule appears in the workspace root, package_path will be empty string and the startswith guard has no effect.

Fixes bazel-contrib#1499
  • Loading branch information
alexeagle committed Feb 28, 2020
1 parent 628c2c5 commit bf85ff8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/pkg_npm/pkg_npm.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ PKG_NPM_OUTPUTS = {
def _filter_out_external_files(ctx, files, package_path):
result = []
for file in files:
if file.short_path.startswith(package_path):
if file.short_path.startswith(package_path) and not file.short_path.startswith("../"):
result.append(file.path)
else:
for v in ctx.attr.vendor_external:
Expand Down

0 comments on commit bf85ff8

Please sign in to comment.