Merge pull request #330634 from r-ryantm/auto-update/circumflex
[NixPkgs.git] / pkgs / servers / web-apps / wiki-js / update.sh
blob63015800e6913d14dd8bbb7593904c397d2e1d39
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p curl common-updater-scripts
4 oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion wiki-js" | tr -d '"')"
5 latestTag="$(git ls-remote --tags --sort="v:refname" https://github.com/Requarks/wiki.git | tail -1 | awk '{ print $2 }' | sed -E "s,^refs/tags/v(.*)$,\1,")"
7 targetVersion="${1:-$latestTag}"
8 if [ ! "${oldVersion}" = "${targetVersion}" ]; then
9 update-source-version wiki-js "${targetVersion}"
10 nix-build -A wiki-js
11 else
12 echo "wiki-js is already up-to-date"