external repos: fix typo confusing workspace_file_content and build_file_content
Fixes #5838
Change-Id: Ic5f730f97b43682b1efc537a02c861d49d3606cc
PiperOrigin-RevId: 208044984
diff --git a/tools/build_defs/repo/utils.bzl b/tools/build_defs/repo/utils.bzl
index e23556c..8a1ecaa 100644
--- a/tools/build_defs/repo/utils.bzl
+++ b/tools/build_defs/repo/utils.bzl
@@ -29,8 +29,9 @@
def workspace_and_buildfile(ctx):
"""Utility function for writing WORKSPACE and, if requested, a BUILD file.
- It assumes the paramters name, build_file, and build_file_contents to be
- present in ctx.attr, the latter two possibly with value None.
+ It assumes the parameters name, build_file, build_file_contents,
+ workspace_file, and workspace_file_content to be
+ present in ctx.attr, the latter four possibly with value None.
Args:
ctx: The repository context of the repository rule calling this utility
@@ -49,7 +50,7 @@
elif ctx.attr.workspace_file_content:
bash_exe = ctx.os.environ["BAZEL_SH"] if "BAZEL_SH" in ctx.os.environ else "bash"
ctx.execute([bash_exe, "-c", "rm -f WORKSPACE"])
- ctx.file("WORKSPACE", ctx.attr.build_file_content)
+ ctx.file("WORKSPACE", ctx.attr.workspace_file_content)
else:
ctx.file("WORKSPACE", "workspace(name = \"{name}\")\n".format(name = ctx.name))