Remove previously installed viewer

More permission issues encountered if a job is repeated. That is, when attempting to replace an existing installed viewer.
master
AtlasLinden 2025-07-10 10:27:16 -07:00 committed by GitHub
parent c70875e0ba
commit db5af314b9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 3 deletions

View File

@ -511,12 +511,20 @@ jobs:
exit 1
fi
# Use the default macOS installer to copy the .app to /Applications
APP_NAME=$(basename "$APP_PATH")
DEST_PATH="/Applications/$APP_NAME"
# Remove existing installation if it exists to avoid permission conflicts
if [ -d "$DEST_PATH" ]; then
echo "Removing existing installation..."
sudo rm -rf "$DEST_PATH"
fi
# Copy the .app to /Applications
cp -R "$APP_PATH" /Applications/
# Verify the app was copied successfully
APP_NAME=$(basename "$APP_PATH")
if [ ! -d "/Applications/$APP_NAME" ]; then
if [ ! -d "$DEST_PATH" ]; then
echo "❌ Error: Failed to install application to /Applications!"
exit 1
fi