ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / oa / oama / update.sh
blob60d1c74cbca144c64ff8d84c997b10703281f7be
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="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
8 derivation_file="${script_dir}/generated-package.nix"
9 latest_version="$(curl --silent https://api.github.com/repos/pdobsan/oama/releases/latest | jq --raw-output '.tag_name')"
11 echo "Updating oama to version ${latest_version}."
12 echo "Running cabal2nix and outputting to ${derivation_file}..."
14 cat > "${derivation_file}" << EOF
15 # This file has been autogenerate with cabal2nix.
16 # Update via ./update.sh
17 EOF
19 cabal2nix --revision "${latest_version}" https://github.com/pdobsan/oama.git >> "${derivation_file}"
20 nixfmt "${derivation_file}"
22 echo "Finished."