From 634283c04e746c4bfff61d82b3b7debb735641a5 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 15 Nov 2023 07:50:51 -0500 Subject: [PATCH] Update zigbee2mqtt.sh follow https://github.com/Koenkk/zigbee2mqtt/commit/311ea070b167ddc6d8de1f8922aed0d8b38025d7 --- ct/zigbee2mqtt.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/ct/zigbee2mqtt.sh b/ct/zigbee2mqtt.sh index 14b75066..9f679fe6 100644 --- a/ct/zigbee2mqtt.sh +++ b/ct/zigbee2mqtt.sh @@ -94,7 +94,13 @@ function update_script() { exit 1 } - echo "Initiating update" + echo "Checking if any changes were made to package-lock.json..." + git checkout package-lock.json || { + echo "Failed to check package-lock.json." + exit 1 + } + + echo "Initiating update..." if ! git pull; then echo "Update failed, temporarily storing changes and trying again." git stash && git pull || ( @@ -109,6 +115,12 @@ function update_script() { exit 1 } + echo "Building..." + npm run build || { + echo "Failed to build new version." + exit 1 + } + echo "Restoring configuration..." cp -R data-backup/* data || { echo "Failed to restore configuration."