Add the ability to format in asset name into post download command
This commit is contained in:
parent
de1032cdbb
commit
e046c9a92a
@ -436,7 +436,9 @@ def _parse_args(args: Optional[list[str]] = None) -> argparse.Namespace:
|
|||||||
help="Map a platform.machine() value to a custom value",
|
help="Map a platform.machine() value to a custom value",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--exec", "-c", help="Shell commands to execute after download or extraction"
|
"--exec",
|
||||||
|
"-c",
|
||||||
|
help="Shell commands to execute after download or extraction. {} will be expanded to the downloaded asset name.",
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--extract-files",
|
"--extract-files",
|
||||||
@ -537,7 +539,7 @@ def main():
|
|||||||
|
|
||||||
# Optionally execute post command
|
# Optionally execute post command
|
||||||
if args.exec:
|
if args.exec:
|
||||||
check_call(args.exec, shell=True)
|
check_call(args.exec.format(asset["name"]), shell=True)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
Loading…
Reference in New Issue
Block a user