File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -19,15 +19,18 @@ echo "Downloading: $ZIP_NAME"
1919cd /tmp
2020curl -sL " $ZIP_URL " -o app.zip
2121
22- # before deleting the folder, stop it
23- arduino-app-cli app stop user:scratch-arduino-app
22+ # Check if app exists and stop it before updating
23+ if [ -d " $HOME /ArduinoApps/scratch-arduino-app" ]; then
24+ echo " Stopping existing application..."
25+ arduino-app-cli app stop user:scratch-arduino-app || echo " Warning: Failed to stop app (may not be running)"
26+ rm -rf $HOME /ArduinoApps/scratch-arduino-app
27+ fi
2428
2529unzip -q app.zip
26- rm -rf $HOME /ArduinoApps/scratch-arduino-app
2730mv -f scratch-arduino-app $HOME /ArduinoApps/
2831rm -f app.zip
2932
30- echo " Installation completed: $ZIP_NAME installed at $HOME /ArduinoApps/scratch-arduino-app"
33+ echo " Installed $ZIP_NAME at $HOME /ArduinoApps/scratch-arduino-app"
3134
3235arduino-app-cli app start user:scratch-arduino-app
3336arduino-app-cli properties set default user:scratch-arduino-app
You can’t perform that action at this time.
0 commit comments