mastodon: 4.3.1 -> 4.3.2 (#361487)
[NixPkgs.git] / pkgs / applications / office / morgen / update.sh
blobe12f86a04bbca85e69da536f0cb3ff5f42f20bb5
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl jq common-updater-scripts
4 set -euo pipefail
6 # URL to check for the latest version
7 latestUrl="https://dl.todesktop.com/210203cqcj00tw1/linux/deb/x64"
9 # Fetch the latest version information
10 latestInfo=$(curl -sI -X GET $latestUrl | grep -oP 'morgen-\K\d+(\.\d+)*(?=[^\d])')
12 if [[ -z "$latestInfo" ]]; then
13 echo "Could not find the latest version number."
14 exit 1
17 # Extract the version number
18 latestVersion=$(echo "$latestInfo" | head -n 1)
20 echo "Latest version of Morgen is $latestVersion"
22 # Update the package definition
23 update-source-version morgen "$latestVersion"
25 # Fetch and update the hash
26 nix-prefetch-url --unpack "https://dl.todesktop.com/210203cqcj00tw1/versions/${latestVersion}/linux/deb"