From c7775f7009422cd20d2a2f345fe90a8513775ebb Mon Sep 17 00:00:00 2001 From: dido18 Date: Mon, 3 Nov 2025 20:53:25 +0100 Subject: [PATCH 1/2] fix: ensure existing application is stopped before updating during installation --- install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index d6921c7..ad3e779 100755 --- a/install.sh +++ b/install.sh @@ -19,11 +19,14 @@ echo "Downloading: $ZIP_NAME" cd /tmp curl -sL "$ZIP_URL" -o app.zip -# before deleting the folder, stop it -arduino-app-cli app stop user:scratch-arduino-app +# Check if app exists and stop it before updating +if [ -d "$HOME/ArduinoApps/scratch-arduino-app" ]; then + echo "Stopping existing application..." + arduino-app-cli app stop user:scratch-arduino-app || echo "Warning: Failed to stop app (may not be running)" + rm -rf $HOME/ArduinoApps/scratch-arduino-app +fi unzip -q app.zip -rm -rf $HOME/ArduinoApps/scratch-arduino-app mv -f scratch-arduino-app $HOME/ArduinoApps/ rm -f app.zip From 5f6eb4b2ca7517d96ef6400543a369949fd1eadb Mon Sep 17 00:00:00 2001 From: dido18 Date: Mon, 3 Nov 2025 20:55:17 +0100 Subject: [PATCH 2/2] fix: update installation completion message for clarity --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index ad3e779..52092bc 100755 --- a/install.sh +++ b/install.sh @@ -30,7 +30,7 @@ unzip -q app.zip mv -f scratch-arduino-app $HOME/ArduinoApps/ rm -f app.zip -echo "Installation completed: $ZIP_NAME installed at $HOME/ArduinoApps/scratch-arduino-app" +echo "Installed $ZIP_NAME at $HOME/ArduinoApps/scratch-arduino-app" arduino-app-cli app start user:scratch-arduino-app arduino-app-cli properties set default user:scratch-arduino-app