2020-08-20 17:08:02 +00:00
|
|
|
#!/usr/bin/env nix-shell
|
2021-12-19 01:06:50 +00:00
|
|
|
#! nix-shell -I nixpkgs=../../.. -i bash -p nodePackages.node2nix curl jq nix-update common-updater-scripts
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
CURRENT_VERSION=$(nix eval -f ../../.. --raw zigbee2mqtt.version)
|
|
|
|
TARGET_VERSION="$(curl https://api.github.com/repos/Koenkk/zigbee2mqtt/releases/latest | jq -r ".tag_name")"
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
if [[ "$CURRENT_VERSION" == "$TARGET_VERSION" ]]; then
|
|
|
|
echo "zigbee2mqtt is up-to-date: ${CURRENT_VERSION}"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
ZIGBEE2MQTT=https://github.com/Koenkk/zigbee2mqtt/raw/$TARGET_VERSION
|
2020-12-07 07:45:13 +00:00
|
|
|
curl -LO $ZIGBEE2MQTT/package.json
|
2022-07-14 12:49:19 +00:00
|
|
|
curl -LO $ZIGBEE2MQTT/package-lock.json
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
node2nix \
|
|
|
|
--composition node.nix \
|
2022-07-14 12:49:19 +00:00
|
|
|
--lock package-lock.json \
|
2021-12-19 01:06:50 +00:00
|
|
|
--development \
|
2020-08-20 17:08:02 +00:00
|
|
|
--no-copy-node-env \
|
2021-12-19 01:06:50 +00:00
|
|
|
--node-env ../../development/node-packages/node-env.nix \
|
|
|
|
--nodejs-14 \
|
|
|
|
--output node-packages.nix
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
rm package.json package-lock.json
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
(
|
|
|
|
cd ../../../
|
|
|
|
update-source-version zigbee2mqtt "$TARGET_VERSION"
|
|
|
|
)
|