2021-08-17 21:37:58 +01:00
|
|
|
#!/usr/bin/env nix-shell
|
2021-11-30 15:04:59 +00:00
|
|
|
#! nix-shell -i bash -p nodePackages.node2nix nodejs-12_x curl jq nix nix-prefetch-git
|
2021-08-17 21:37:58 +01:00
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
# cd to the folder containing this script
|
|
|
|
cd "$(dirname "$0")"
|
|
|
|
|
2021-11-30 15:49:36 +00:00
|
|
|
CURRENT_VERSION=$(nix-instantiate ../../../../. --eval --strict -A matrix-appservice-irc.version | tr -d '"')
|
2021-11-07 21:18:22 +00: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 21:37:58 +01: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 22:47:32 +01: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 21:37:58 +01:00
|
|
|
|
|
|
|
./generate-dependencies.sh
|
|
|
|
|
2021-09-07 22:47:32 +01:00
|
|
|
rm ./package-lock-temp.json
|
|
|
|
|
2021-11-30 15:04:59 +00:00
|
|
|
nix-prefetch-git --rev "$TARGET_VERSION" --url "https://github.com/matrix-org/matrix-appservice-irc" > ./src.json
|