nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1#!/usr/bin/env nix-shell
2#!nix-shell -i bash -p bash nix-update common-updater-scripts nix jq
3
4set -euo pipefail
5
6BASEDIR="$(dirname "$0")/../../../.."
7
8currentVersion=$(nix-instantiate --eval -E "with import $BASEDIR {}; hoppscotch.version or (lib.getVersion hoppscotch)" | tr -d '"')
9latestVersion=$(curl ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} -sL https://api.github.com/repos/hoppscotch/releases/releases/latest | jq --raw-output .tag_name | sed 's/^v//')
10
11if [[ "$currentVersion" == "$latestVersion" ]]; then
12 echo "package is up-to-date: $currentVersion"
13 exit 0
14fi
15
16update-source-version hoppscotch $latestVersion || true
17
18for system in \
19 x86_64-linux \
20 x86_64-darwin \
21 aarch64-darwin; do
22 hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 $(nix-prefetch-url $(nix-instantiate --eval -E "with import $BASEDIR {}; hoppscotch.src.url" --system "$system" | tr -d '"')))
23 (cd $BASEDIR && update-source-version hoppscotch $latestVersion $hash --system=$system --ignore-same-version)
24done