From 4cbcd00e4ee787d815bf37f81df7584785415937 Mon Sep 17 00:00:00 2001 From: zeus Date: Sat, 12 Aug 2023 15:55:07 +0200 Subject: [PATCH] add: snap URL-fetcher --- bash/get_snap_download_link.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100755 bash/get_snap_download_link.sh diff --git a/bash/get_snap_download_link.sh b/bash/get_snap_download_link.sh new file mode 100755 index 0000000..c5ba0d0 --- /dev/null +++ b/bash/get_snap_download_link.sh @@ -0,0 +1,3 @@ +#!/bin/bash +# Usage: $basename snap_packagename +PACKAGE=$1; curl -s -H 'Snap-Device-Series: 16' http://api.snapcraft.io/v2/snaps/info/$PACKAGE | jq '."channel-map" | map(select(.channel.architecture == "amd64" and .channel.name == "stable")) | .[0].download.url'