fix: expose bare jq/jq.exe binary (#20)

This commit is contained in:
Alex Eagle 2021-12-18 11:13:24 -08:00 committed by GitHub
parent 87cecb51a2
commit 885fcb3f6e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 5 deletions

View File

@ -178,11 +178,9 @@ def _jq_platform_repo_impl(repository_ctx):
)
build_content = """#Generated by lib/repositories.bzl
load("@aspect_bazel_lib//lib/private:jq_toolchain.bzl", "jq_toolchain")
jq_toolchain(name = "jq_toolchain", bin = select({
"@bazel_tools//src/conditions:host_windows": ":jq.exe",
"//conditions:default": ":jq",
}), visibility = ["//visibility:public"])
"""
exports_files(["{0}"])
jq_toolchain(name = "jq_toolchain", bin = "{0}", visibility = ["//visibility:public"])
""".format("jq.exe" if is_windows else "jq")
# Base BUILD file for this repository
repository_ctx.file("BUILD.bazel", build_content)