matrix-appservice-irc: improve update script

This commit is contained in:
piegames 2021-11-07 22:18:22 +01:00
parent 7f54eb0861
commit be0c385a5d
3 changed files with 2 additions and 4 deletions

View file

@ -5,7 +5,7 @@ let
inherit pkgs nodejs;
inherit (stdenv.hostPlatform) system;
};
version = builtins.replaceStrings [ "\n" ] [ "" ] (builtins.readFile ./REVISION);
version = (lib.importJSON ./package.json).version;
in
ourNodePackages.package.override {
pname = "matrix-appservice-irc";

View file

@ -6,7 +6,7 @@ set -euo pipefail
cd "$(dirname "$0")"
CURRENT_VERSION=$(nix eval --raw '(with import ../../../../. {}; matrix-appservice-irc.version)')
TARGET_VERSION="$(curl https://api.github.com/repos/matrix-org/matrix-appservice-irc/releases/latest | jq -r ".tag_name")"
TARGET_VERSION="$(curl https://api.github.com/repos/matrix-org/matrix-appservice-irc/releases/latest | jq --exit-status -r ".tag_name")"
if [[ "$CURRENT_VERSION" == "$TARGET_VERSION" ]]; then
echo "matrix-appservice-irc is up-to-date: ${CURRENT_VERSION}"
@ -18,7 +18,6 @@ echo "matrix-appservice-irc: $CURRENT_VERSION -> $TARGET_VERSION"
rm -f package.json package-lock.json
wget https://github.com/matrix-org/matrix-appservice-irc/raw/$TARGET_VERSION/package.json
wget -O package-lock-temp.json https://github.com/matrix-org/matrix-appservice-irc/raw/$TARGET_VERSION/package-lock.json
echo "$TARGET_VERSION" > ./REVISION
./generate-dependencies.sh