run buildifier on build/workspace_mirror.bzl

pull/8/head
Jeff Grafton 2018-05-07 16:41:33 -07:00
parent e76c62274a
commit 8bf47d7237
1 changed files with 19 additions and 19 deletions

View File

@ -20,16 +20,16 @@ def mirror(url):
Update the GCS bucket using bazel run //hack:update-mirror"""
return [prefix + url, url]
def mirror_urls():
# This function only gives proper results when executed from WORKSPACE,
# but the data is needed in sh_binary, which can only be in a BUILD file.
# Thus, it is be exported by a repository_rule (which executes in WORKSPACE)
# to be used by the sh_binary.
def mirror_urls():
urls = []
for k, v in native.existing_rules().items():
us = list(v.get('urls', []))
if 'url' in v:
us.append(v['url'])
us = list(v.get("urls", []))
if "url" in v:
us.append(v["url"])
for u in us:
if u and not u.startswith(prefix):
urls.append(u)