1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl jq common-updater-scripts
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."
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"