Fix glob in bower2bazel.py This fixes I850271bb1c657a5ffe77946a6beaf54a3680af75. Change-Id: I128ae1b88adc267b0f1f9b1db7b0a96a87a861b3
diff --git a/tools/js/bower2bazel.py b/tools/js/bower2bazel.py index ea0402c..2114de7 100755 --- a/tools/js/bower2bazel.py +++ b/tools/js/bower2bazel.py
@@ -77,11 +77,10 @@ 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.