chromium,chromedriver: 129.0.6668.91 -> 129.0.6668.100
[NixPkgs.git] / pkgs / by-name / lo / loopwm / update.sh
blob82b720fa98fd3329c955437cac5a7af0ec303b19
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl jq gnused
4 set -euo pipefail
6 cd "$(dirname "$0")" || exit 1
8 # Grab latest release version
9 LOOPWM_LATEST_VER="$(curl --fail -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} "https://api.github.com/repos/MrKai77/Loop/releases/latest" | jq -r '.tag_name' | sed 's/^v//')"
10 LOOPWM_CURRENT_VER="$(grep -oP 'version = "\K[^"]+' package.nix)"
12 if [[ "$LOOPWM_LATEST_VER" == "$LOOPWM_CURRENT_VER" ]]; then
13 echo "loopwm is up-to-date"
14 exit 0
17 LOOPWM_DARWIN_HASH="$(nix-hash --to-sri --type sha256 "$(nix-prefetch-url --type sha256 "https://github.com/MrKai77/Loop/releases/download/${LOOPWM_LATEST_VER}/Loop.zip")")"
19 sed -i "s#hash = \".*\"#hash = \"$LOOPWM_DARWIN_HASH\"#g" package.nix
20 sed -i "s#version = \".*\";#version = \"$LOOPWM_LATEST_VER\";#g" package.nix