Fix glob in bower2bazel.py

This fixes I850271bb1c657a5ffe77946a6beaf54a3680af75.

Change-Id: I128ae1b88adc267b0f1f9b1db7b0a96a87a861b3
(cherry picked from commit 9ffd58a82b)
This commit is contained in:
Logan Hanks
2017-06-16 10:55:21 -07:00
committed by David Pursehouse
parent 5cb381960f
commit b824e5ee2e

View File

@@ -76,11 +76,10 @@ def build_bower_json(version_targets, seeds):
seeds = set(seeds)
for v in version_targets:
try:
fn = os.path.join("bazel-out/local-fastbuild/bin", v.lstrip("/").replace(":", "/"))
except:
fn = os.path.join("bazel-out/darwin_x86_64-fastbuild/bin", v.lstrip("/").replace(":", "/"))
with open(fn) as f:
path = os.path.join("bazel-out/*-fastbuild/bin", v.lstrip("/").replace(":", "/"))
fs = glob.glob(path)
assert len(fs) == 1, '%s: file not found or multiple files found: %s' % (path, fs)
with open(fs[0]) as f:
j = json.load(f)
if "" in j:
# drop dummy entries.