• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1def _generate_script_impl(ctx):
2    script_file = ctx.actions.declare_file(ctx.label.name + ".bash")
3    ctx.actions.write(output = script_file, is_executable = True, content = """
4{0}
5""".format(ctx.file.binary.short_path))
6    return struct(
7        files = depset([script_file]),
8    )
9
10generate_script = rule(
11    _generate_script_impl,
12    attrs = {
13        "binary": attr.label(
14            allow_single_file = True,
15        ),
16    },
17)
18