fix: only use ctx.attr.patches if patches param is not specified (#105)
The currently implementation differs from the docstring here and in upstream skylib: This rule is intended to be used in the implementation function of a repository rule. If the parameters "patches", "patch_tool", "patch_args", "patch_cmds" and "patch_cmds_win" are not specified then they are taken from "ctx.attr".
This commit is contained in:
parent
2b50f99ab3
commit
47114fd4f9
|
@ -71,10 +71,10 @@ def patch(ctx, patches = None, patch_cmds = None, patch_cmds_win = None, patch_t
|
|||
bash_exe = ctx.os.environ["BAZEL_SH"] if "BAZEL_SH" in ctx.os.environ else "bash"
|
||||
powershell_exe = ctx.os.environ["BAZEL_POWERSHELL"] if "BAZEL_POWERSHELL" in ctx.os.environ else "powershell.exe"
|
||||
|
||||
if patches == None and hasattr(ctx.attr, "patches"):
|
||||
patches = ctx.attr.patches
|
||||
if patches == None:
|
||||
patches = []
|
||||
if hasattr(ctx.attr, "patches") and ctx.attr.patches:
|
||||
patches += ctx.attr.patches
|
||||
|
||||
remote_patches = {}
|
||||
remote_patch_strip = 0
|
||||
|
|
Loading…
Reference in New Issue