Add the ability to format in asset name into post download command

This commit is contained in:
IamTheFij 2022-06-08 08:50:20 -07:00
parent de1032cdbb
commit e046c9a92a

View File

@ -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__":