about summary refs log tree commit diff
path: root/pkgs/by-name/pl/plasticity/update.sh
blob: 8980f632e3ee4a0cf23985c5d505b7db15aecb64 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq common-updater-scripts
#shellcheck shell=bash

set -eu -o pipefail

version=$(curl -s ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
    curl -s https://api.github.com/repos/nkallen/plasticity/releases/latest | jq -e -r ".tag_name | .[1:]")
old_version=$(nix-instantiate --eval -A plasticity.version | jq -e -r)

if [[ $version == "$old_version" ]]; then
    echo "New version same as old version, nothing to do." >&2
    exit 0
fi

update-source-version plasticity "$version"