From a6e694b604f3ef758cc006307327ca58b9027f52 Mon Sep 17 00:00:00 2001 From: Jason Morley Date: Mon, 11 Sep 2023 15:39:43 -1000 Subject: [PATCH] fix: Select the command from multiple assets --- scripts/latest.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scripts/latest.py b/scripts/latest.py index c9beab6..bb06306 100755 --- a/scripts/latest.py +++ b/scripts/latest.py @@ -27,9 +27,13 @@ def main(): params={'per_page': 1}) assert len(releases) == 1 assets = gh.get(releases[0]['assets_url']) - assert len(assets) == 1 - url = assets[0]['browser_download_url'] - print(url) + + # Select the correct asset. + for asset in assets: + if asset["name"].startswith("incontext-"): + print(asset["browser_download_url"]) + exit() + exit("Failed to find command asset.") if __name__ == "__main__":