forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / by-name / gr / gren / update.sh
blob1b697ecb88dd868be0b7f5b7adc7bfd07374d8f1
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p cabal2nix curl jq nixfmt-rfc-style
4 set -euo pipefail
6 # This is the directory of this update.sh script.
7 script_dir="$(dirname "${BASH_SOURCE[0]}")"
8 derivation_file="${script_dir}/generated-package.nix"
9 latest_version="$(curl --silent 'https://api.github.com/repos/gren-lang/compiler/releases/latest' | jq --raw-output '.tag_name')"
11 echo "Updating gren to version ${latest_version}."
12 echo "Running cabal2nix and outputting to ${derivation_file}..."
14 cat > "${derivation_file}" << EOF
15 # This file has been autogenerated with cabal2nix.
16 # Update via ./update.sh
17 EOF
19 cabal2nix 'https://github.com/gren-lang/compiler.git' --revision "${latest_version}" --jailbreak >> "${derivation_file}"
20 nixfmt "${derivation_file}"
22 echo 'Finished.'