Skip to content

Commit

Permalink
workspace mirror: add trailing newline to urls list
Browse files Browse the repository at this point in the history
  • Loading branch information
ixdy committed May 7, 2018
1 parent 8bf47d7 commit b9efd1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion build/workspace_mirror.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ def export_urls_impl(repo_ctx):
repo_ctx.file(repo_ctx.path("BUILD.bazel"), """
exports_files(glob(["**"]), visibility=["//visibility:public"])
""")
repo_ctx.file(repo_ctx.path("urls.txt"), content = "\n".join(repo_ctx.attr.urls))
repo_ctx.file(
repo_ctx.path("urls.txt"),
# Add a trailing newline, since the "while read" loop needs it
content = ("\n".join(repo_ctx.attr.urls) + "\n"),
)

_export_urls = repository_rule(
attrs = {
Expand Down
2 changes: 1 addition & 1 deletion hack/update-workspace-mirror.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -o nounset
set -o pipefail

if [[ $# -ne 1 ]]; then
echo 'use "bazel run //build:update-mirror"'
echo 'use "bazel run //hack:update-mirror"'
echo "(usage: $0 <file with list of URLs to mirror>)"
exit 1
fi
Expand Down

0 comments on commit b9efd1f

Please sign in to comment.