2021-08-17 22:37:58 +02:00
|
|
|
#!/usr/bin/env nix-shell
|
2021-11-30 16:04:59 +01:00
|
|
|
#! nix-shell -i bash -p nodePackages.node2nix nodejs-12_x curl jq nix nix-prefetch-git
|
2021-08-17 22:37:58 +02:00
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
# cd to the folder containing this script
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
2021-11-30 16:49:36 +01:00
|
|
|
CURRENT_VERSION=$(nix-instantiate ../../../../. --eval --strict -A matrix-appservice-irc.version | tr -d '"')
|
2021-11-07 22:18:22 +01:00
|
|
|
TARGET_VERSION="$(curl https://api.github.com/repos/matrix-org/matrix-appservice-irc/releases/latest | jq --exit-status -r ".tag_name")"
|
2021-08-17 22:37:58 +02:00
|
|
|
|
|
|
|
if [[ "$CURRENT_VERSION" == "$TARGET_VERSION" ]]; then
|
|
|
|
echo "matrix-appservice-irc is up-to-date: ${CURRENT_VERSION}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "matrix-appservice-irc: $CURRENT_VERSION -> $TARGET_VERSION"
|
|
|
|
|
2021-09-07 23:47:32 +02:00
|
|
|
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
|
2021-08-17 22:37:58 +02:00
|
|
|
|
|
|
|
./generate-dependencies.sh
|
|
|
|
|
2021-09-07 23:47:32 +02:00
|
|
|
rm ./package-lock-temp.json
|
|
|
|
|
2021-11-30 16:04:59 +01:00
|
|
|
nix-prefetch-git --rev "$TARGET_VERSION" --url "https://github.com/matrix-org/matrix-appservice-irc" > ./src.json
|