evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / we / webcord / update.sh
blobea79effc869a68c5a7e2ca46c7263eb58b2cde40
1 #! /usr/bin/env nix-shell
2 #! nix-shell -i bash -p curl jq nix-update
4 set -ex
6 curl_github() {
7 curl -L ${GITHUB_TOKEN:+" -u \":$GITHUB_TOKEN\""} "$@"
10 latestTag=$(curl_github https://api.github.com/repos/SpacingBat3/Webcord/releases/latest | jq -r ".tag_name")
11 latestVersion="$(expr "$latestTag" : 'v\(.*\)')"
13 nix-update --version "$latestVersion" webcord
14 electronVersion=$(curl_github "https://raw.githubusercontent.com/SpacingBat3/WebCord/v$latestVersion/package.json" | jq -r ".devDependencies.electron" | sed -r 's|^\^([0-9]+).*|\1|')
15 sed -r "/webcord = / s|(electron_)[0-9]+|\1$electronVersion|" -i pkgs/top-level/all-packages.nix