From e046c9a92adda2924ca233ab64b83366a15fa9b5 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Wed, 8 Jun 2022 08:50:20 -0700 Subject: [PATCH] Add the ability to format in asset name into post download command --- release_gitter.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/release_gitter.py b/release_gitter.py index 5d64aca..8b5cd6c 100755 --- a/release_gitter.py +++ b/release_gitter.py @@ -436,7 +436,9 @@ def _parse_args(args: Optional[list[str]] = None) -> argparse.Namespace: help="Map a platform.machine() value to a custom value", ) 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( "--extract-files", @@ -537,7 +539,7 @@ def main(): # Optionally execute post command if args.exec: - check_call(args.exec, shell=True) + check_call(args.exec.format(asset["name"]), shell=True) if __name__ == "__main__":