1 #!/usr/bin/env nix-shell
2 #!nix-shell -I nixpkgs=./. -i bash -p curl common-updater-scripts
4 latestVersion
=$
(curl
-s "https://www.hifile.app/otherdownloads" |
grep -A 10 '<h1>All downloads</h1>' |
grep -m 1 '<li>.*AppImage.*' |
sed -n 's/.*HiFile-\([0-9.]*\)\.AppImage.*/\1/p')
5 currentVersion
=$
(nix-instantiate
--eval -E "with import ./. {}; hifile.version" |
tr -d '"')
7 echo "latest version: $latestVersion"
8 echo "current version: $currentVersion"
10 if [[ "$latestVersion" == "$currentVersion" ]]; then
11 echo "package is up-to-date"
16 prefetch
=$
(nix-prefetch-url
"https://www.hifile.app/files/HiFile-$latestVersion.AppImage")
17 hash=$
(nix-hash
--type sha256
--to-sri "$prefetch")
19 update-source-version hifile
0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system="x86_64-linux"
20 update-source-version hifile
"$latestVersion" "$hash" --system="x86_64-linux"