diff --git a/new.sh b/new.sh new file mode 100644 index 0000000..5853627 --- /dev/null +++ b/new.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +repo_tags=$(curl 'https://api.github.com/repos/zen-browser/desktop/tags' -s) + +twilight_tag=$(echo "$repo_tags" | jq -r '.[]|select(.name|test("twilight"))') +beta_tag=$(echo "$repo_tags" | jq -r '(map(select(.name | test("-b.")))) | first') + +try_to_update() { + name=$1 + arch=$2 + target_tag_meta=$3 + + meta=$(jq ".[\"$name\"][\"$arch-linux\"]" sources.json.tmp + mv sources.json.tmp sources.json + + echo "$name was updated to $version" + fi +} + +set -e + +try_to_update "beta" "x86_64" "$beta_tag" +try_to_update "beta" "aarch64" "$beta_tag" +try_to_update "twilight" "x86_64" "$twilight_tag" +try_to_update "twilight" "aarch64" "$twilight_tag"