summaryrefslogtreecommitdiffstats
path: root/pkgs/applications/gis/qgis/update.sh
blob: 6cddde3fe07b0056ff9477914d1ccd63cba320b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p common-updater-scripts curl jq

set -eu -o pipefail

url="https://version.qgis.org/version.json"

package="$1"

function make_version {
    jq --raw-output '[.major, .minor, .patch] | join(".")'
}

if [ "$package" == "qgis" ]; then
    version="$(curl --silent $url | jq '.latest' | make_version)"
elif [ "$package" == "qgis-ltr" ]; then
    version="$(curl --silent $url | jq '.ltr' | make_version)"
fi

update-source-version "$package.unwrapped" "$version"