Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 26 lines 1.1 kB view raw
1#!/usr/bin/env nix-shell 2#!nix-shell -i bash -p bash nix curl coreutils jq common-updater-scripts 3 4set -eou pipefail 5 6latestVersion=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/VSCodium/vscodium/releases/latest | jq -r ".tag_name") 7currentVersion=$(nix-instantiate --eval -E "with import ./. {}; vscodium.version or (lib.getVersion vscodium)" | tr -d '"') 8 9echo "latest version: $latestVersion" 10echo "current version: $currentVersion" 11 12if [[ "$latestVersion" == "$currentVersion" ]]; then 13 echo "package is up-to-date" 14 exit 0 15fi 16 17for i in \ 18 "x86_64-linux linux-x64 tar.gz" \ 19 "aarch64-linux linux-arm64 tar.gz" \ 20 "armv7l-linux linux-armhf tar.gz" \ 21 "aarch64-darwin darwin-arm64 zip" \ 22 "x86_64-darwin darwin-x64 zip"; do 23 set -- $i 24 hash=$(nix --extra-experimental-features nix-command hash convert --hash-algo sha256 --to sri $(nix-prefetch-url "https://github.com/VSCodium/vscodium/releases/download/$latestVersion/VSCodium-$2-$latestVersion.$3")) 25 update-source-version vscodium $latestVersion $hash --system=$1 --ignore-same-version 26done