about summary refs log tree commit diff
path: root/pkgs/by-name/pl/plasticity/update.sh
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/pl/plasticity/update.sh')
-rwxr-xr-xpkgs/by-name/pl/plasticity/update.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/pkgs/by-name/pl/plasticity/update.sh b/pkgs/by-name/pl/plasticity/update.sh
new file mode 100755
index 000000000000..8980f632e3ee
--- /dev/null
+++ b/pkgs/by-name/pl/plasticity/update.sh
@@ -0,0 +1,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"
+