You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
1004 B

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl common-updater-scripts jq
set -eu -o pipefail
oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion oh-my-zsh" | tr -d '"')"
latestSha="$(curl -L -s\?sha\=master\&since\=${oldVersion} | jq -r '.[0].sha')"
url="$(nix-instantiate --eval -E "with import ./. {}; oh-my-zsh.src.url" | tr -d '"')"
if [ ! "null" = "${latestSha}" ]; then
latestDate="$(curl -L -s${latestSha} | jq '' | sed 's|"\(.*\)T.*|\1|g')"
update-source-version oh-my-zsh "${latestSha}" --version-key=rev
update-source-version oh-my-zsh "${latestDate}" --ignore-same-hash
nixpkgs="$(git rev-parse --show-toplevel)"
git add "${default_nix}"
git commit -m "oh-my-zsh: ${oldVersion} -> ${latestDate}"
echo "oh-my-zsh is already up-to-date"