Skip to content

Update Fleet-maintained apps - #50779

Closed
fleet-release wants to merge 1 commit into
mainfrom
fma-2608071600
Closed

Update Fleet-maintained apps#50779
fleet-release wants to merge 1 commit into
mainfrom
fma-2608071600

Conversation

@fleet-release

@fleet-release fleet-release commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Automated ingestion of latest Fleet-maintained app data.

Summary by CodeRabbit

  • Updates
    • Refreshed versions and installation metadata for a broad range of macOS and Windows applications, including browsers, productivity tools, developer utilities, communication apps, and VPN clients.
    • Updated download links, release detection, and integrity checks to support the latest available releases.
  • Bug Fixes
    • Improved uninstall behavior for select applications by removing associated services, support files, caches, logs, and user data.
    • Added safer application cleanup, including quitting running apps before removal.

Generated automatically with cmd/maintained-apps.
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Script Diff Results

ee/maintained-apps/outputs/alt-tab/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/amadine/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/applite/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/arc/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json

=== Install Script (no changes) ===
=== Uninstall // 7ef6154e -> abc2830e ===

--- /tmp/old.oG9vkn	2026-08-07 16:09:44.508913391 +0000
+++ /tmp/new.O3SmKS	2026-08-07 16:09:44.508913391 +0000
@@ -188,10 +188,11 @@
   fi
 }
 
-remove_launchctl_service 'aviatrix.vpn.client.rp.plist'
+remove_launchctl_service 'aviatrix.vpn.client.rp'
 remove_pkg_files 'com.Aviatrix.VPNClient'
 forget_pkg 'com.Aviatrix.VPNClient'
 sudo rm -rf '/Applications/Aviatrix VPN Client.app'
+trash $LOGGED_IN_USER '/Library/Application Support/Aviatrix VPN Client'
 trash $LOGGED_IN_USER '~/Library/Aviatrix'
 trash $LOGGED_IN_USER '~/Library/Logs/AviatrixVPNC'
 trash $LOGGED_IN_USER '~/Library/Preferences/org.pythonmac.unspecified.AviatrixVPNClient.plist'

ee/maintained-apps/outputs/badgeify/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/beekeeper-studio/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/brave-browser/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/burp-suite/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/calibre/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/calibre/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/capcut/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/chatbox/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/chatgpt/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/cherry-studio/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/citrix-workspace/darwin.json

=== Install // f06e00fd -> a78b38b6 ===

--- /tmp/old.lil5di	2026-08-07 16:09:44.930917940 +0000
+++ /tmp/new.n0Ittz	2026-08-07 16:09:44.930917940 +0000
@@ -96,5 +96,5 @@
 
 # install pkg files
 quit_and_track_application 'com.citrix.receiver.nomas'
-sudo installer -pkg "$TMPDIR/CitrixWorkspaceAppUniversal26.03.11.41.pkg" -target / || exit $?
+sudo installer -pkg "$TMPDIR/CitrixWorkspaceAppUniversal26.07.0.71.pkg" -target / || exit $?
 relaunch_application 'com.citrix.receiver.nomas'

=== Uninstall // edbf2a34 -> c847120e ===

--- /tmp/old.Eu8bUH	2026-08-07 16:09:44.948918134 +0000
+++ /tmp/new.xjF0Qu	2026-08-07 16:09:44.949918145 +0000
@@ -233,6 +233,7 @@
 remove_launchctl_service 'com.citrix.CtxWorkspaceHelperDaemon'
 remove_launchctl_service 'com.citrix.ctxworkspaceupdater'
 remove_launchctl_service 'com.citrix.devicetrust.launchagent'
+remove_launchctl_service 'com.citrix.PluginBroker'
 remove_launchctl_service 'com.citrix.ReceiverHelper'
 remove_launchctl_service 'com.citrix.ReceiverUninstallHelper'
 remove_launchctl_service 'com.citrix.ReceiverUpdaterHelper'
@@ -259,6 +260,9 @@
 forget_pkg 'com.citrix.ICAClienthdx'
 remove_pkg_files 'com.citrix.receiver.bcr'
 forget_pkg 'com.citrix.receiver.bcr'
+sudo rm -rf '/Applications/Citrix Workspace.app'
+sudo rm -rf '/Library/Citrix Workspace'
+trash $LOGGED_IN_USER '/Library/Logs/Citrix Workspace'
 trash $LOGGED_IN_USER '~/Library/Application Support/Citrix Receiver'
 trash $LOGGED_IN_USER '~/Library/Application Support/Citrix Workspace'
 trash $LOGGED_IN_USER '~/Library/Application Support/Citrix'

ee/maintained-apps/outputs/claude/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/clion/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/cmake-app/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/codexbar/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/coteditor/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/cursor/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/dataflare/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/dataflare/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/datagrip/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/deezer/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/downie/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/drawio/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/drofus/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/elevate-uc/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/evernote/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/fellow/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/firefox@nightly/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/framer/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/gitkraken/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/gog-galaxy/darwin.json

=== Install // 9f170824 -> 89b9a1b7 ===

--- /tmp/old.SyecvQ	2026-08-07 16:09:45.638925571 +0000
+++ /tmp/new.z49rwa	2026-08-07 16:09:45.638925571 +0000
@@ -96,5 +96,5 @@
 
 # install pkg files
 quit_and_track_application 'com.gog.galaxy.cef.renderer'
-sudo installer -pkg "$TMPDIR/galaxy_client_2.1.7.22.pkg" -target / || exit $?
+sudo installer -pkg "$TMPDIR/galaxy_client_2.1.8.32.pkg" -target / || exit $?
 relaunch_application 'com.gog.galaxy.cef.renderer'

=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/google-chrome/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/granola/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/granola/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/ibm-semeru-jre-11/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/imageglass/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/kiro-cli/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/kiro/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/kiro/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/krita/darwin.json

=== Install Script (no changes) ===
=== Uninstall // 7b9f27dc -> 3947b0f0 ===

--- /tmp/old.FQqqGp	2026-08-07 16:09:45.948928913 +0000
+++ /tmp/new.tBPM8p	2026-08-07 16:09:45.948928913 +0000
@@ -52,8 +52,11 @@
   fi
 }
 
-sudo rm -rf "$APPDIR/krita.app"
-trash $LOGGED_IN_USER '~/Library/Application Support/krita'
+sudo rm -rf "$APPDIR/Krita.app"
+trash $LOGGED_IN_USER '~/Library/Application Scripts/org.krita.*'
+trash $LOGGED_IN_USER '~/Library/Application Support/krita*'
+trash $LOGGED_IN_USER '~/Library/Caches/krita'
+trash $LOGGED_IN_USER '~/Library/Containers/org.krita.*'
 trash $LOGGED_IN_USER '~/Library/Preferences/kritadisplayrc'
 trash $LOGGED_IN_USER '~/Library/Preferences/kritarc'
 trash $LOGGED_IN_USER '~/Library/Saved Application State/org.krita.savedState'

ee/maintained-apps/outputs/loom/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/loom/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/marked-app/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/masscode/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/melodics/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/microsoft-edge/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/mongodb-compass/darwin.json

=== Install Script (no changes) ===
=== Uninstall // 9db6b9b2 -> 022cab65 ===

--- /tmp/old.BBnSEZ	2026-08-07 16:09:46.199931769 +0000
+++ /tmp/new.XQiHAQ	2026-08-07 16:09:46.200931780 +0000
@@ -5,6 +5,46 @@
 LOGGED_IN_USER=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }')
 # functions
 
+quit_application() {
+  local bundle_id="$1"
+  local timeout_duration=10
+
+  # check if the application is running
+  local app_running
+  app_running=$(osascript -e "application id \"$bundle_id\" is running" 2>/dev/null)
+  if [[ "$app_running" != "true" ]]; then
+    return
+  fi
+
+  local console_user
+  console_user=$(stat -f "%Su" /dev/console)
+  if [[ -z "$console_user" || "$console_user" == "root" || "$console_user" == "loginwindow" ]]; then
+    echo "Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'."
+    return
+  fi
+
+  echo "Quitting application '$bundle_id'..."
+
+  # try to quit the application within the timeout period
+  local quit_success=false
+  SECONDS=0
+  while (( SECONDS < timeout_duration )); do
+    if osascript -e "tell application id \"$bundle_id\" to quit" >/dev/null 2>&1; then
+      if ! pgrep -f "$bundle_id" >/dev/null 2>&1; then
+        echo "Application '$bundle_id' quit successfully."
+        quit_success=true
+        break
+      fi
+    fi
+    sleep 1
+  done
+
+  if [[ "$quit_success" = false ]]; then
+    echo "Application '$bundle_id' did not quit."
+  fi
+}
+
+
 trash() {
   local logged_in_user="$1"
   local target_file="$2"
@@ -52,6 +92,7 @@
   fi
 }
 
+quit_application 'com.mongodb.compass'
 sudo rm -rf "$APPDIR/MongoDB Compass.app"
 trash $LOGGED_IN_USER '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.mongodb.compass.sfl*'
 trash $LOGGED_IN_USER '~/Library/Application Support/MongoDB Compass'

ee/maintained-apps/outputs/mongodb-compass/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/nordpass/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/nordpass/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/notesnook/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/nova/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/onedrive/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/opencode-desktop/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/opera/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/orbstack/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/p4v/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/p4v/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/pale-moon/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/parallels/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/postman/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/postman/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/powerphotos/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/prisma-browser/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/prisma-browser/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/proton-drive/darwin.json

=== Install Script (no changes) ===
=== Uninstall // fc6f5099 -> ac89ef74 ===

--- /tmp/old.fNf0dd	2026-08-07 16:09:46.930940284 +0000
+++ /tmp/new.9QbOWv	2026-08-07 16:09:46.930940284 +0000
@@ -5,6 +5,76 @@
 LOGGED_IN_USER=$(scutil <<< "show State:/Users/ConsoleUser" | awk '/Name :/ { print $3 }')
 # functions
 
+remove_launchctl_service() {
+  local service="$1"
+  local booleans=("true" "false")
+  local plist_status
+  local paths
+  local should_sudo
+
+  echo "Removing launchctl service ${service}"
+
+  # A wildcard label can't be used with launchctl or as a plist name, so expand
+  # it to the labels of currently loaded services that match the pattern.
+  local services=("$service")
+  if [[ "$service" == *"*"* ]]; then
+    local regex
+    # Escape regex metacharacters, turn '*' into '.*', and anchor the pattern so
+    # it matches a full label rather than a substring.
+    regex=$(printf '%s' "$service" | sed -e 's/[][(){}.^$+?|\\]/\\&/g' -e 's/\*/.*/g')
+    regex="^${regex}$"
+    services=()
+    local id
+    # Match every loaded job by label regardless of PID; launchctl list reports
+    # loaded-but-not-running jobs with a "-" in the PID column.
+    while read -r _ _ id; do
+      [[ "$id" =~ $regex ]] && services+=("$id")
+    done < <(launchctl list 2>/dev/null | tail -n +2)
+    if [[ ${#services[@]} -eq 0 ]]; then
+      echo "No loaded launchctl service matches ${service}"
+      return
+    fi
+  fi
+
+  local service_label
+  for service_label in "${services[@]}"; do
+    for should_sudo in "${booleans[@]}"; do
+      plist_status=$(launchctl list "${service_label}" 2>/dev/null)
+
+      if [[ $plist_status == \{* ]]; then
+        if [[ $should_sudo == "true" ]]; then
+          sudo launchctl remove "${service_label}"
+        else
+          launchctl remove "${service_label}"
+        fi
+        sleep 1
+      fi
+
+      paths=(
+        "/Library/LaunchAgents/${service_label}.plist"
+        "/Library/LaunchDaemons/${service_label}.plist"
+      )
+
+      # if not using sudo, prepend the home directory to the paths
+      if [[ $should_sudo == "false" ]]; then
+        for i in "${!paths[@]}"; do
+          paths[i]="${HOME}${paths[i]}"
+        done
+      fi
+
+      for path in "${paths[@]}"; do
+        if [[ -e "$path" ]]; then
+          if [[ $should_sudo == "true" ]]; then
+            sudo rm -f -- "$path"
+          else
+            rm -f -- "$path"
+          fi
+        fi
+      done
+    done
+  done
+}
+
 trash() {
   local logged_in_user="$1"
   local target_file="$2"
@@ -52,6 +122,7 @@
   fi
 }
 
+remove_launchctl_service 'ch.protonmail.drive.agent'
 sudo rm -rf "$APPDIR/Proton Drive.app"
 trash $LOGGED_IN_USER '~/Library/Application Scripts/ch.protonmail.drive*'
 trash $LOGGED_IN_USER '~/Library/Application Support/FileProvider/ch.protonmail.drive.fileprovider'

ee/maintained-apps/outputs/rider/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/rive/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/rustrover/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/rustrover/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/shapr3d/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/spokenly/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/spotify/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/spyder/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/superwhisper/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/sync/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/telegram/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/viscosity/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/viscosity/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/vivaldi/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/webex/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/whatsapp/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/windows-app/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/wispr-flow/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/workflowy/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/xnconvert/windows.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

ee/maintained-apps/outputs/zen/darwin.json

=== Install Script (no changes) ===
=== Uninstall Script (no changes) ===

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Updated maintained-app output manifests for many macOS and Windows applications. Most changes update versions, patch queries, installer URLs, and SHA-256 checksums. Selected entries also update install or uninstall script references and cleanup behavior for Aviatrix VPN Client, Citrix Workspace, GOG Galaxy, Krita, MongoDB Compass, and Proton Drive.

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description identifies the automated app-data update but omits the required issue reference, checklist, testing details, and applicable validation information. Add the required template sections, complete applicable checklist items, provide the related issue or mark it not applicable, and document testing.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: updating Fleet-maintained application data.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fma-2608071600

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json`:
- Line 20: Update remove_launchctl_service and its callers in
ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json lines 20-20,
ee/maintained-apps/outputs/gog-galaxy/darwin.json lines 19-19,
ee/maintained-apps/outputs/proton-drive/darwin.json lines 19-19, and
ee/maintained-apps/outputs/grammarly-desktop/darwin.json line 20 to bind each
operation to the correct console-user or system launchctl domain, use the
console user UID for user agents, avoid targeting root-owned agent paths, and
unload every loaded service before deleting its plist.

In `@ee/maintained-apps/outputs/citrix-workspace/darwin.json`:
- Line 20: Update the Citrix Workspace log cleanup call using trash so
/Library/Logs/Citrix Workspace is moved with elevated privileges. Extend trash
to support privileged moves or add a dedicated sudo path for this target, while
preserving the existing unprivileged behavior for user-library paths.

In `@ee/maintained-apps/outputs/coteditor/darwin.json`:
- Around line 4-12: Update the CotEditor manifest’s compatibility logic to
prevent version 7.0.8 from deploying on macOS 14 hosts. Add the repository’s
established minimum-OS guard for macOS 15, or adjust the release stream to
retain a CotEditor version supporting macOS 14; keep the existing version,
installer, and query behavior unchanged otherwise.

In `@ee/maintained-apps/outputs/kiro/darwin.json`:
- Line 9: Update the installer_url in the darwin configuration to reference a
universal macOS installer rather than the darwin-arm64 artifact, so the generic
darwin target supports both Intel and Apple silicon Macs.

In `@ee/maintained-apps/outputs/mongodb-compass/darwin.json`:
- Line 19: Update quit_application to return a non-zero status when Compass is
still running after the timeout or when no valid non-root GUI session is
available; preserve success only when the application is confirmed stopped or
was not running. At the caller, check quit_application's result and exit before
sudo rm -rf and subsequent trash calls when it fails.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c86f1594-07bf-4225-94f7-c46492f65ffe

📥 Commits

Reviewing files that changed from the base of the PR and between 9b5e977 and 907c664.

📒 Files selected for processing (92)
  • ee/maintained-apps/outputs/alt-tab/darwin.json
  • ee/maintained-apps/outputs/amadine/darwin.json
  • ee/maintained-apps/outputs/applite/darwin.json
  • ee/maintained-apps/outputs/arc/darwin.json
  • ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json
  • ee/maintained-apps/outputs/badgeify/darwin.json
  • ee/maintained-apps/outputs/beekeeper-studio/windows.json
  • ee/maintained-apps/outputs/brave-browser/windows.json
  • ee/maintained-apps/outputs/burp-suite/darwin.json
  • ee/maintained-apps/outputs/calibre/darwin.json
  • ee/maintained-apps/outputs/calibre/windows.json
  • ee/maintained-apps/outputs/capcut/darwin.json
  • ee/maintained-apps/outputs/chatbox/windows.json
  • ee/maintained-apps/outputs/chatgpt/darwin.json
  • ee/maintained-apps/outputs/cherry-studio/darwin.json
  • ee/maintained-apps/outputs/citrix-workspace/darwin.json
  • ee/maintained-apps/outputs/claude/darwin.json
  • ee/maintained-apps/outputs/clion/windows.json
  • ee/maintained-apps/outputs/cmake-app/windows.json
  • ee/maintained-apps/outputs/codexbar/darwin.json
  • ee/maintained-apps/outputs/coteditor/darwin.json
  • ee/maintained-apps/outputs/cursor/darwin.json
  • ee/maintained-apps/outputs/dataflare/darwin.json
  • ee/maintained-apps/outputs/dataflare/windows.json
  • ee/maintained-apps/outputs/datagrip/darwin.json
  • ee/maintained-apps/outputs/deezer/darwin.json
  • ee/maintained-apps/outputs/downie/darwin.json
  • ee/maintained-apps/outputs/drawio/darwin.json
  • ee/maintained-apps/outputs/drofus/windows.json
  • ee/maintained-apps/outputs/elevate-uc/windows.json
  • ee/maintained-apps/outputs/evernote/windows.json
  • ee/maintained-apps/outputs/fellow/windows.json
  • ee/maintained-apps/outputs/firefox@nightly/darwin.json
  • ee/maintained-apps/outputs/framer/darwin.json
  • ee/maintained-apps/outputs/gitkraken/windows.json
  • ee/maintained-apps/outputs/gog-galaxy/darwin.json
  • ee/maintained-apps/outputs/google-chrome/darwin.json
  • ee/maintained-apps/outputs/granola/darwin.json
  • ee/maintained-apps/outputs/granola/windows.json
  • ee/maintained-apps/outputs/ibm-semeru-jre-11/windows.json
  • ee/maintained-apps/outputs/imageglass/windows.json
  • ee/maintained-apps/outputs/kiro-cli/darwin.json
  • ee/maintained-apps/outputs/kiro/darwin.json
  • ee/maintained-apps/outputs/kiro/windows.json
  • ee/maintained-apps/outputs/krita/darwin.json
  • ee/maintained-apps/outputs/loom/darwin.json
  • ee/maintained-apps/outputs/loom/windows.json
  • ee/maintained-apps/outputs/marked-app/darwin.json
  • ee/maintained-apps/outputs/masscode/darwin.json
  • ee/maintained-apps/outputs/melodics/darwin.json
  • ee/maintained-apps/outputs/microsoft-edge/darwin.json
  • ee/maintained-apps/outputs/mongodb-compass/darwin.json
  • ee/maintained-apps/outputs/mongodb-compass/windows.json
  • ee/maintained-apps/outputs/nordpass/darwin.json
  • ee/maintained-apps/outputs/nordpass/windows.json
  • ee/maintained-apps/outputs/notesnook/windows.json
  • ee/maintained-apps/outputs/nova/darwin.json
  • ee/maintained-apps/outputs/onedrive/windows.json
  • ee/maintained-apps/outputs/opencode-desktop/darwin.json
  • ee/maintained-apps/outputs/opera/darwin.json
  • ee/maintained-apps/outputs/orbstack/darwin.json
  • ee/maintained-apps/outputs/p4v/darwin.json
  • ee/maintained-apps/outputs/p4v/windows.json
  • ee/maintained-apps/outputs/pale-moon/windows.json
  • ee/maintained-apps/outputs/parallels/darwin.json
  • ee/maintained-apps/outputs/postman/darwin.json
  • ee/maintained-apps/outputs/postman/windows.json
  • ee/maintained-apps/outputs/powerphotos/darwin.json
  • ee/maintained-apps/outputs/prisma-browser/darwin.json
  • ee/maintained-apps/outputs/prisma-browser/windows.json
  • ee/maintained-apps/outputs/proton-drive/darwin.json
  • ee/maintained-apps/outputs/rider/windows.json
  • ee/maintained-apps/outputs/rive/darwin.json
  • ee/maintained-apps/outputs/rustrover/darwin.json
  • ee/maintained-apps/outputs/rustrover/windows.json
  • ee/maintained-apps/outputs/shapr3d/darwin.json
  • ee/maintained-apps/outputs/spokenly/darwin.json
  • ee/maintained-apps/outputs/spotify/darwin.json
  • ee/maintained-apps/outputs/spyder/windows.json
  • ee/maintained-apps/outputs/superwhisper/darwin.json
  • ee/maintained-apps/outputs/sync/darwin.json
  • ee/maintained-apps/outputs/telegram/windows.json
  • ee/maintained-apps/outputs/viscosity/darwin.json
  • ee/maintained-apps/outputs/viscosity/windows.json
  • ee/maintained-apps/outputs/vivaldi/darwin.json
  • ee/maintained-apps/outputs/webex/darwin.json
  • ee/maintained-apps/outputs/whatsapp/darwin.json
  • ee/maintained-apps/outputs/windows-app/windows.json
  • ee/maintained-apps/outputs/wispr-flow/darwin.json
  • ee/maintained-apps/outputs/workflowy/darwin.json
  • ee/maintained-apps/outputs/xnconvert/windows.json
  • ee/maintained-apps/outputs/zen/darwin.json

"refs": {
"692de513": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n# functions\n\nquit_and_track_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n eval \"export $var_name=0\"\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n eval \"export $var_name=0\"\n return\n fi\n\n # App was running, mark it for relaunch\n eval \"export $var_name=1\"\n echo \"Application '$bundle_id' was running; will relaunch after installation.\"\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nrelaunch_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local was_running\n\n # Check if the app was running before installation\n eval \"was_running=\\$$var_name\"\n if [[ \"$was_running\" != \"1\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping relaunching application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Relaunching application '$bundle_id'...\"\n\n # Launch the app in the logged-in user's GUI session. Apps launched by root\n # won't register with the user's Dock/GUI, so run 'open' as the console user.\n # Use 'launchctl asuser' to bootstrap into the console user's Mach namespace\n # and GUI session — 'sudo -u' alone doesn't do this, which can cause\n # LSOpenURLsWithRole() failures even when 'open' exits 0.\n local open_status=0\n if [[ $EUID -eq 0 ]]; then\n local console_uid\n console_uid=$(id -u \"$console_user\")\n /bin/launchctl asuser \"$console_uid\" sudo -u \"$console_user\" open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n else\n open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n fi\n\n if [[ $open_status -eq 0 ]]; then\n echo \"Application '$bundle_id' relaunched successfully.\"\n else\n echo \"Failed to relaunch application '$bundle_id'.\"\n fi\n}\n\n\n# install pkg files\nquit_and_track_application 'org.pythonmac.unspecified.AviatrixVPNClient'\nsudo installer -pkg \"$TMPDIR/AVPNC_mac.pkg\" -target / || exit $?\nrelaunch_application 'org.pythonmac.unspecified.AviatrixVPNClient'\n",
"7ef6154e": "#!/bin/bash\n\n# variables\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nexpand_pkgid_and_map() {\n local PKGID=\"$1\"\n local FUNC=\"$2\"\n if [[ \"$PKGID\" == *\"*\" ]]; then\n local prefix=\"${PKGID%\\*}\"\n echo \"Expanding wildcard for PKGID: $PKGID\"\n for receipt in $(pkgutil --pkgs | grep \"^${prefix}\"); do\n echo \"Processing $receipt\"\n \"$FUNC\" \"$receipt\"\n done\n else\n \"$FUNC\" \"$PKGID\"\n fi\n}\n\nforget_pkg() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" forget_receipt\n}\n\nforget_receipt() {\n local PKGID=\"$1\"\n sudo pkgutil --forget \"$PKGID\"\n}\n\nremove_launchctl_service() {\n local service=\"$1\"\n local booleans=(\"true\" \"false\")\n local plist_status\n local paths\n local should_sudo\n\n echo \"Removing launchctl service ${service}\"\n\n # A wildcard label can't be used with launchctl or as a plist name, so expand\n # it to the labels of currently loaded services that match the pattern.\n local services=(\"$service\")\n if [[ \"$service\" == *\"*\"* ]]; then\n local regex\n # Escape regex metacharacters, turn '*' into '.*', and anchor the pattern so\n # it matches a full label rather than a substring.\n regex=$(printf '%s' \"$service\" | sed -e 's/[][(){}.^$+?|\\\\]/\\\\&/g' -e 's/\\*/.*/g')\n regex=\"^${regex}$\"\n services=()\n local id\n # Match every loaded job by label regardless of PID; launchctl list reports\n # loaded-but-not-running jobs with a \"-\" in the PID column.\n while read -r _ _ id; do\n [[ \"$id\" =~ $regex ]] && services+=(\"$id\")\n done < <(launchctl list 2>/dev/null | tail -n +2)\n if [[ ${#services[@]} -eq 0 ]]; then\n echo \"No loaded launchctl service matches ${service}\"\n return\n fi\n fi\n\n local service_label\n for service_label in \"${services[@]}\"; do\n for should_sudo in \"${booleans[@]}\"; do\n plist_status=$(launchctl list \"${service_label}\" 2>/dev/null)\n\n if [[ $plist_status == \\{* ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo launchctl remove \"${service_label}\"\n else\n launchctl remove \"${service_label}\"\n fi\n sleep 1\n fi\n\n paths=(\n \"/Library/LaunchAgents/${service_label}.plist\"\n \"/Library/LaunchDaemons/${service_label}.plist\"\n )\n\n # if not using sudo, prepend the home directory to the paths\n if [[ $should_sudo == \"false\" ]]; then\n for i in \"${!paths[@]}\"; do\n paths[i]=\"${HOME}${paths[i]}\"\n done\n fi\n\n for path in \"${paths[@]}\"; do\n if [[ -e \"$path\" ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo rm -f -- \"$path\"\n else\n rm -f -- \"$path\"\n fi\n fi\n done\n done\n done\n}\n\nremove_pkg_files() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" remove_receipt_files\n}\n\nremove_receipt_files() {\n local PKGID=\"$1\"\n local PKGINFO VOLUME INSTALL_LOCATION FULL_INSTALL_LOCATION\n\n echo \"pkgutil --pkg-info-plist \\\"$PKGID\\\"\"\n PKGINFO=$(pkgutil --pkg-info-plist \"$PKGID\")\n VOLUME=$(echo \"$PKGINFO\" | awk '/<key>volume<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n INSTALL_LOCATION=$(echo \"$PKGINFO\" | awk '/<key>install-location<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n\n if [ -z \"$INSTALL_LOCATION\" ] || [ \"$INSTALL_LOCATION\" = \"/\" ]; then\n FULL_INSTALL_LOCATION=\"$VOLUME\"\n else\n FULL_INSTALL_LOCATION=\"$VOLUME/$INSTALL_LOCATION\"\n FULL_INSTALL_LOCATION=$(echo \"$FULL_INSTALL_LOCATION\" | sed 's|//|/|g')\n fi\n\n echo \"sudo pkgutil --only-files --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-files --files \"$PKGID\" | sed \"s|^|/${INSTALL_LOCATION}/|\" | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n echo \"sudo pkgutil --only-dirs --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | grep '\\\\.app$' | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-dirs --files \"$PKGID\" | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" | grep '\\.app$' | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n root_app_dir=$(\n sudo pkgutil --only-dirs --files \"$PKGID\" \\\n | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" \\\n | grep 'Applications' \\\n | awk '{ print length, $0 }' \\\n | sort -n \\\n | head -n1 \\\n | cut -d' ' -f2-\n )\n if [ -n \"$root_app_dir\" ]; then\n echo \"sudo rmdir -p \\\"$root_app_dir\\\" 2>/dev/null || :\"\n sudo rmdir -p \"$root_app_dir\" 2>/dev/null || :\n fi\n}\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nremove_launchctl_service 'aviatrix.vpn.client.rp.plist'\nremove_pkg_files 'com.Aviatrix.VPNClient'\nforget_pkg 'com.Aviatrix.VPNClient'\nsudo rm -rf '/Applications/Aviatrix VPN Client.app'\ntrash $LOGGED_IN_USER '~/Library/Aviatrix'\ntrash $LOGGED_IN_USER '~/Library/Logs/AviatrixVPNC'\ntrash $LOGGED_IN_USER '~/Library/Preferences/org.pythonmac.unspecified.AviatrixVPNClient.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/org.pythonmac.unspecified.AviatrixVPNClient.savedState'\n"
"abc2830e": "#!/bin/bash\n\n# variables\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nexpand_pkgid_and_map() {\n local PKGID=\"$1\"\n local FUNC=\"$2\"\n if [[ \"$PKGID\" == *\"*\" ]]; then\n local prefix=\"${PKGID%\\*}\"\n echo \"Expanding wildcard for PKGID: $PKGID\"\n for receipt in $(pkgutil --pkgs | grep \"^${prefix}\"); do\n echo \"Processing $receipt\"\n \"$FUNC\" \"$receipt\"\n done\n else\n \"$FUNC\" \"$PKGID\"\n fi\n}\n\nforget_pkg() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" forget_receipt\n}\n\nforget_receipt() {\n local PKGID=\"$1\"\n sudo pkgutil --forget \"$PKGID\"\n}\n\nremove_launchctl_service() {\n local service=\"$1\"\n local booleans=(\"true\" \"false\")\n local plist_status\n local paths\n local should_sudo\n\n echo \"Removing launchctl service ${service}\"\n\n # A wildcard label can't be used with launchctl or as a plist name, so expand\n # it to the labels of currently loaded services that match the pattern.\n local services=(\"$service\")\n if [[ \"$service\" == *\"*\"* ]]; then\n local regex\n # Escape regex metacharacters, turn '*' into '.*', and anchor the pattern so\n # it matches a full label rather than a substring.\n regex=$(printf '%s' \"$service\" | sed -e 's/[][(){}.^$+?|\\\\]/\\\\&/g' -e 's/\\*/.*/g')\n regex=\"^${regex}$\"\n services=()\n local id\n # Match every loaded job by label regardless of PID; launchctl list reports\n # loaded-but-not-running jobs with a \"-\" in the PID column.\n while read -r _ _ id; do\n [[ \"$id\" =~ $regex ]] && services+=(\"$id\")\n done < <(launchctl list 2>/dev/null | tail -n +2)\n if [[ ${#services[@]} -eq 0 ]]; then\n echo \"No loaded launchctl service matches ${service}\"\n return\n fi\n fi\n\n local service_label\n for service_label in \"${services[@]}\"; do\n for should_sudo in \"${booleans[@]}\"; do\n plist_status=$(launchctl list \"${service_label}\" 2>/dev/null)\n\n if [[ $plist_status == \\{* ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo launchctl remove \"${service_label}\"\n else\n launchctl remove \"${service_label}\"\n fi\n sleep 1\n fi\n\n paths=(\n \"/Library/LaunchAgents/${service_label}.plist\"\n \"/Library/LaunchDaemons/${service_label}.plist\"\n )\n\n # if not using sudo, prepend the home directory to the paths\n if [[ $should_sudo == \"false\" ]]; then\n for i in \"${!paths[@]}\"; do\n paths[i]=\"${HOME}${paths[i]}\"\n done\n fi\n\n for path in \"${paths[@]}\"; do\n if [[ -e \"$path\" ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo rm -f -- \"$path\"\n else\n rm -f -- \"$path\"\n fi\n fi\n done\n done\n done\n}\n\nremove_pkg_files() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" remove_receipt_files\n}\n\nremove_receipt_files() {\n local PKGID=\"$1\"\n local PKGINFO VOLUME INSTALL_LOCATION FULL_INSTALL_LOCATION\n\n echo \"pkgutil --pkg-info-plist \\\"$PKGID\\\"\"\n PKGINFO=$(pkgutil --pkg-info-plist \"$PKGID\")\n VOLUME=$(echo \"$PKGINFO\" | awk '/<key>volume<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n INSTALL_LOCATION=$(echo \"$PKGINFO\" | awk '/<key>install-location<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n\n if [ -z \"$INSTALL_LOCATION\" ] || [ \"$INSTALL_LOCATION\" = \"/\" ]; then\n FULL_INSTALL_LOCATION=\"$VOLUME\"\n else\n FULL_INSTALL_LOCATION=\"$VOLUME/$INSTALL_LOCATION\"\n FULL_INSTALL_LOCATION=$(echo \"$FULL_INSTALL_LOCATION\" | sed 's|//|/|g')\n fi\n\n echo \"sudo pkgutil --only-files --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-files --files \"$PKGID\" | sed \"s|^|/${INSTALL_LOCATION}/|\" | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n echo \"sudo pkgutil --only-dirs --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | grep '\\\\.app$' | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-dirs --files \"$PKGID\" | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" | grep '\\.app$' | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n root_app_dir=$(\n sudo pkgutil --only-dirs --files \"$PKGID\" \\\n | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" \\\n | grep 'Applications' \\\n | awk '{ print length, $0 }' \\\n | sort -n \\\n | head -n1 \\\n | cut -d' ' -f2-\n )\n if [ -n \"$root_app_dir\" ]; then\n echo \"sudo rmdir -p \\\"$root_app_dir\\\" 2>/dev/null || :\"\n sudo rmdir -p \"$root_app_dir\" 2>/dev/null || :\n fi\n}\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nremove_launchctl_service 'aviatrix.vpn.client.rp'\nremove_pkg_files 'com.Aviatrix.VPNClient'\nforget_pkg 'com.Aviatrix.VPNClient'\nsudo rm -rf '/Applications/Aviatrix VPN Client.app'\ntrash $LOGGED_IN_USER '/Library/Application Support/Aviatrix VPN Client'\ntrash $LOGGED_IN_USER '~/Library/Aviatrix'\ntrash $LOGGED_IN_USER '~/Library/Logs/AviatrixVPNC'\ntrash $LOGGED_IN_USER '~/Library/Preferences/org.pythonmac.unspecified.AviatrixVPNClient.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/org.pythonmac.unspecified.AviatrixVPNClient.savedState'\n"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

files=(
  "ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json"
  "ee/maintained-apps/outputs/gog-galaxy/darwin.json"
  "ee/maintained-apps/outputs/proton-drive/darwin.json"
)

for file in "${files[@]}"; do
  ref=$(jq -r '.versions[0].uninstall_script_ref' "$file")
  script=$(mktemp)
  jq -er --arg ref "$ref" '.refs[$ref]' "$file" > "$script"
  bash -n "$script"
  rg -n 'launchctl list|launchctl remove|LOGGED_IN_USER|\$HOME|/Library/Launch' "$script"
  rm -f "$script"
done

rg -n -C 6 'uninstall_script_ref|launchctl|HOME|sudo|exec' \
  cmd/maintained-apps ee/maintained-apps || true

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

files=(
  "ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json"
  "ee/maintained-apps/outputs/gog-galaxy/darwin.json"
  "ee/maintained-apps/outputs/proton-drive/darwin.json"
  "ee/maintained-apps/outputs/grammarly-desktop/darwin.json"
)

for file in "${files[@]}"; do
  echo "## $file"
  jq -r '.versions[0].uninstall_script_ref' "$file"
done

python3 - <<'PY'
import json, os
files = [
 "ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json",
 "ee/maintained-apps/outputs/gog-galaxy/darwin.json",
 "ee/maintained-apps/outputs/proton-drive/darwin.json",
 "ee/maintained-apps/outputs/grammarly-desktop/darwin.json",
]
for path in files:
    data=json.load(open(path))
    ref=data["versions"][0]["uninstall_script_ref"]
    script=data["refs"][ref]
    print(path, ref)
    for pat in ("launchctl list", "launchctl remove", "HOME", "/Library/LaunchAgents", "/Library/LaunchDaemons"):
        print(f"  {pat}: {pat in script}")
    print("  lines with launchctl/LaunchAgents/LaunchDaemons:")
    for i,line in enumerate(script.splitlines(),1):
        if any(s in line for s in ["launchctl", "/Library/LaunchAgents", "/Library/LaunchDaemons", "HOME", "logout", "loginwindow", "console_user", "console_uid"]):
            print(f"    {i}: {line}")
PY

# Check whether unqualified launchctl commands in these refs would target LaunchAgents
# when run as root; no actual launchctl invocation is performed here.
python3 - <<'PY'
import json
ref="abc2830e"
path="ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json"
script=json.load(open(path))["refs"][ref]
print("Has unqualified launchctl list:", "launchctl list" in script and "asuser" not in script and "bootout" not in script)
print("Has unqualified launchctl remove:", "launchctl remove" in script and "asuser" not in script and "bootout" not in script)
print("Uses sudo launchctl remove:", "sudo launchctl remove" in script)
print("Uses /Library/LaunchAgents plist path:", "/Library/LaunchAgents" in script)
print("Uses /Library/LaunchDaemons plist path:", "/Library/LaunchDaemons" in script)
PY

Repository: fleetdm/fleet

Length of output: 5431


Bind every launchctl operation to its target domain.

These uninstall scripts run launchctl list without asuser, scan /Library/LaunchAgents and /Library/LaunchDaemons; when root, this can target /var/root paths, and if a system service is loaded, deleting its plist leaves the service running. Add per-service domain awareness: console user UID for user agents/system daemons or explicit launchctl domain arguments, and make sure loaded services are unloaded before removing owner files.

  • ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json#L20: update ref abc2830e with explicit console-user/system launchctl handling.
  • ee/maintained-apps/outputs/gog-galaxy/darwin.json#L19: apply the same fix to ref 15cc6645.
  • ee/maintained-apps/outputs/proton-drive/darwin.json#L19: apply the same fix to ref ac89ef74.
  • ee/maintained-apps/outputs/grammarly-desktop/darwin.json#:L20: apply the same fix to ref 7dff0961.
📍 Affects 3 files
  • ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json#L20-L20 (this comment)
  • ee/maintained-apps/outputs/gog-galaxy/darwin.json#L19-L19
  • ee/maintained-apps/outputs/proton-drive/darwin.json#L19-L19
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json` at line 20,
Update remove_launchctl_service and its callers in
ee/maintained-apps/outputs/aviatrix-vpn-client/darwin.json lines 20-20,
ee/maintained-apps/outputs/gog-galaxy/darwin.json lines 19-19,
ee/maintained-apps/outputs/proton-drive/darwin.json lines 19-19, and
ee/maintained-apps/outputs/grammarly-desktop/darwin.json line 20 to bind each
operation to the correct console-user or system launchctl domain, use the
console user UID for user agents, avoid targeting root-owned agent paths, and
unload every loaded service before deleting its plist.

"edbf2a34": "#!/bin/bash\n\n# variables\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nexpand_pkgid_and_map() {\n local PKGID=\"$1\"\n local FUNC=\"$2\"\n if [[ \"$PKGID\" == *\"*\" ]]; then\n local prefix=\"${PKGID%\\*}\"\n echo \"Expanding wildcard for PKGID: $PKGID\"\n for receipt in $(pkgutil --pkgs | grep \"^${prefix}\"); do\n echo \"Processing $receipt\"\n \"$FUNC\" \"$receipt\"\n done\n else\n \"$FUNC\" \"$PKGID\"\n fi\n}\n\nforget_pkg() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" forget_receipt\n}\n\nforget_receipt() {\n local PKGID=\"$1\"\n sudo pkgutil --forget \"$PKGID\"\n}\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nremove_launchctl_service() {\n local service=\"$1\"\n local booleans=(\"true\" \"false\")\n local plist_status\n local paths\n local should_sudo\n\n echo \"Removing launchctl service ${service}\"\n\n # A wildcard label can't be used with launchctl or as a plist name, so expand\n # it to the labels of currently loaded services that match the pattern.\n local services=(\"$service\")\n if [[ \"$service\" == *\"*\"* ]]; then\n local regex\n # Escape regex metacharacters, turn '*' into '.*', and anchor the pattern so\n # it matches a full label rather than a substring.\n regex=$(printf '%s' \"$service\" | sed -e 's/[][(){}.^$+?|\\\\]/\\\\&/g' -e 's/\\*/.*/g')\n regex=\"^${regex}$\"\n services=()\n local id\n # Match every loaded job by label regardless of PID; launchctl list reports\n # loaded-but-not-running jobs with a \"-\" in the PID column.\n while read -r _ _ id; do\n [[ \"$id\" =~ $regex ]] && services+=(\"$id\")\n done < <(launchctl list 2>/dev/null | tail -n +2)\n if [[ ${#services[@]} -eq 0 ]]; then\n echo \"No loaded launchctl service matches ${service}\"\n return\n fi\n fi\n\n local service_label\n for service_label in \"${services[@]}\"; do\n for should_sudo in \"${booleans[@]}\"; do\n plist_status=$(launchctl list \"${service_label}\" 2>/dev/null)\n\n if [[ $plist_status == \\{* ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo launchctl remove \"${service_label}\"\n else\n launchctl remove \"${service_label}\"\n fi\n sleep 1\n fi\n\n paths=(\n \"/Library/LaunchAgents/${service_label}.plist\"\n \"/Library/LaunchDaemons/${service_label}.plist\"\n )\n\n # if not using sudo, prepend the home directory to the paths\n if [[ $should_sudo == \"false\" ]]; then\n for i in \"${!paths[@]}\"; do\n paths[i]=\"${HOME}${paths[i]}\"\n done\n fi\n\n for path in \"${paths[@]}\"; do\n if [[ -e \"$path\" ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo rm -f -- \"$path\"\n else\n rm -f -- \"$path\"\n fi\n fi\n done\n done\n done\n}\n\nremove_pkg_files() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" remove_receipt_files\n}\n\nremove_receipt_files() {\n local PKGID=\"$1\"\n local PKGINFO VOLUME INSTALL_LOCATION FULL_INSTALL_LOCATION\n\n echo \"pkgutil --pkg-info-plist \\\"$PKGID\\\"\"\n PKGINFO=$(pkgutil --pkg-info-plist \"$PKGID\")\n VOLUME=$(echo \"$PKGINFO\" | awk '/<key>volume<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n INSTALL_LOCATION=$(echo \"$PKGINFO\" | awk '/<key>install-location<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n\n if [ -z \"$INSTALL_LOCATION\" ] || [ \"$INSTALL_LOCATION\" = \"/\" ]; then\n FULL_INSTALL_LOCATION=\"$VOLUME\"\n else\n FULL_INSTALL_LOCATION=\"$VOLUME/$INSTALL_LOCATION\"\n FULL_INSTALL_LOCATION=$(echo \"$FULL_INSTALL_LOCATION\" | sed 's|//|/|g')\n fi\n\n echo \"sudo pkgutil --only-files --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-files --files \"$PKGID\" | sed \"s|^|/${INSTALL_LOCATION}/|\" | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n echo \"sudo pkgutil --only-dirs --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | grep '\\\\.app$' | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-dirs --files \"$PKGID\" | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" | grep '\\.app$' | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n root_app_dir=$(\n sudo pkgutil --only-dirs --files \"$PKGID\" \\\n | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" \\\n | grep 'Applications' \\\n | awk '{ print length, $0 }' \\\n | sort -n \\\n | head -n1 \\\n | cut -d' ' -f2-\n )\n if [ -n \"$root_app_dir\" ]; then\n echo \"sudo rmdir -p \\\"$root_app_dir\\\" 2>/dev/null || :\"\n sudo rmdir -p \"$root_app_dir\" 2>/dev/null || :\n fi\n}\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nremove_launchctl_service 'com.citrix.AuthManager_Mac'\nremove_launchctl_service 'com.citrix.ctxusbd'\nremove_launchctl_service 'com.citrix.CtxWorkspaceHelperDaemon'\nremove_launchctl_service 'com.citrix.ctxworkspaceupdater'\nremove_launchctl_service 'com.citrix.devicetrust.launchagent'\nremove_launchctl_service 'com.citrix.ReceiverHelper'\nremove_launchctl_service 'com.citrix.ReceiverUninstallHelper'\nremove_launchctl_service 'com.citrix.ReceiverUpdaterHelper'\nremove_launchctl_service 'com.citrix.safariadapter'\nremove_launchctl_service 'com.citrix.ServiceRecords'\nremove_launchctl_service 'com.citrix.UninstallMonitor'\nquit_application 'Citrix.ServiceRecords'\nquit_application 'com.citrix.CitrixReceiverLauncher'\nquit_application 'com.citrix.receiver.nomas'\nquit_application 'com.citrix.ReceiverHelper'\nremove_pkg_files 'com.citrix.common'\nforget_pkg 'com.citrix.common'\nremove_pkg_files 'com.citrix.devicetrust.client'\nforget_pkg 'com.citrix.devicetrust.client'\nremove_pkg_files 'com.citrix.devicetrust.client.ica'\nforget_pkg 'com.citrix.devicetrust.client.ica'\nremove_pkg_files 'com.citrix.enterprisebrowserinstaller'\nforget_pkg 'com.citrix.enterprisebrowserinstaller'\nremove_pkg_files 'com.citrix.ICAClient'\nforget_pkg 'com.citrix.ICAClient'\nremove_pkg_files 'com.citrix.ICAClientcwa'\nforget_pkg 'com.citrix.ICAClientcwa'\nremove_pkg_files 'com.citrix.ICAClienthdx'\nforget_pkg 'com.citrix.ICAClienthdx'\nremove_pkg_files 'com.citrix.receiver.bcr'\nforget_pkg 'com.citrix.receiver.bcr'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Citrix Receiver'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Citrix Workspace'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Citrix'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.CitrixReceiverLauncher'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.HdxRtcEngine'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.receiver*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.ReceiverUpdater'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.citrix.receiver*'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.citrix.CitrixReceiverLauncher'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.citrix.receiver*'\ntrash $LOGGED_IN_USER '~/Library/Logs/Citrix Workspace'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.AuthManager.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.CitrixReceiverLauncher.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.HdxRtcEngine.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.receiver*.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.Receiver*.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.citrix.receiver.nomas.savedState'\ntrash $LOGGED_IN_USER '~/Library/WebKit/com.citrix.receiver.nomas'\n",
"f06e00fd": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n# functions\n\nquit_and_track_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n eval \"export $var_name=0\"\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n eval \"export $var_name=0\"\n return\n fi\n\n # App was running, mark it for relaunch\n eval \"export $var_name=1\"\n echo \"Application '$bundle_id' was running; will relaunch after installation.\"\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nrelaunch_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local was_running\n\n # Check if the app was running before installation\n eval \"was_running=\\$$var_name\"\n if [[ \"$was_running\" != \"1\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping relaunching application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Relaunching application '$bundle_id'...\"\n\n # Launch the app in the logged-in user's GUI session. Apps launched by root\n # won't register with the user's Dock/GUI, so run 'open' as the console user.\n # Use 'launchctl asuser' to bootstrap into the console user's Mach namespace\n # and GUI session — 'sudo -u' alone doesn't do this, which can cause\n # LSOpenURLsWithRole() failures even when 'open' exits 0.\n local open_status=0\n if [[ $EUID -eq 0 ]]; then\n local console_uid\n console_uid=$(id -u \"$console_user\")\n /bin/launchctl asuser \"$console_uid\" sudo -u \"$console_user\" open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n else\n open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n fi\n\n if [[ $open_status -eq 0 ]]; then\n echo \"Application '$bundle_id' relaunched successfully.\"\n else\n echo \"Failed to relaunch application '$bundle_id'.\"\n fi\n}\n\n\n# install pkg files\nquit_and_track_application 'com.citrix.receiver.nomas'\nsudo installer -pkg \"$TMPDIR/CitrixWorkspaceAppUniversal26.03.11.41.pkg\" -target / || exit $?\nrelaunch_application 'com.citrix.receiver.nomas'\n"
"a78b38b6": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nTMPDIR=$(dirname \"$(realpath \"$INSTALLER_PATH\")\")\n# functions\n\nquit_and_track_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n eval \"export $var_name=0\"\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n eval \"export $var_name=0\"\n return\n fi\n\n # App was running, mark it for relaunch\n eval \"export $var_name=1\"\n echo \"Application '$bundle_id' was running; will relaunch after installation.\"\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nrelaunch_application() {\n local bundle_id=\"$1\"\n local var_name=\"APP_WAS_RUNNING_$(echo \"$bundle_id\" | tr '.-' '__')\"\n local was_running\n\n # Check if the app was running before installation\n eval \"was_running=\\$$var_name\"\n if [[ \"$was_running\" != \"1\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping relaunching application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Relaunching application '$bundle_id'...\"\n\n # Launch the app in the logged-in user's GUI session. Apps launched by root\n # won't register with the user's Dock/GUI, so run 'open' as the console user.\n # Use 'launchctl asuser' to bootstrap into the console user's Mach namespace\n # and GUI session — 'sudo -u' alone doesn't do this, which can cause\n # LSOpenURLsWithRole() failures even when 'open' exits 0.\n local open_status=0\n if [[ $EUID -eq 0 ]]; then\n local console_uid\n console_uid=$(id -u \"$console_user\")\n /bin/launchctl asuser \"$console_uid\" sudo -u \"$console_user\" open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n else\n open -b \"$bundle_id\" >/dev/null 2>&1 || open_status=$?\n fi\n\n if [[ $open_status -eq 0 ]]; then\n echo \"Application '$bundle_id' relaunched successfully.\"\n else\n echo \"Failed to relaunch application '$bundle_id'.\"\n fi\n}\n\n\n# install pkg files\nquit_and_track_application 'com.citrix.receiver.nomas'\nsudo installer -pkg \"$TMPDIR/CitrixWorkspaceAppUniversal26.07.0.71.pkg\" -target / || exit $?\nrelaunch_application 'com.citrix.receiver.nomas'\n",
"c847120e": "#!/bin/bash\n\n# variables\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nexpand_pkgid_and_map() {\n local PKGID=\"$1\"\n local FUNC=\"$2\"\n if [[ \"$PKGID\" == *\"*\" ]]; then\n local prefix=\"${PKGID%\\*}\"\n echo \"Expanding wildcard for PKGID: $PKGID\"\n for receipt in $(pkgutil --pkgs | grep \"^${prefix}\"); do\n echo \"Processing $receipt\"\n \"$FUNC\" \"$receipt\"\n done\n else\n \"$FUNC\" \"$PKGID\"\n fi\n}\n\nforget_pkg() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" forget_receipt\n}\n\nforget_receipt() {\n local PKGID=\"$1\"\n sudo pkgutil --forget \"$PKGID\"\n}\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\nremove_launchctl_service() {\n local service=\"$1\"\n local booleans=(\"true\" \"false\")\n local plist_status\n local paths\n local should_sudo\n\n echo \"Removing launchctl service ${service}\"\n\n # A wildcard label can't be used with launchctl or as a plist name, so expand\n # it to the labels of currently loaded services that match the pattern.\n local services=(\"$service\")\n if [[ \"$service\" == *\"*\"* ]]; then\n local regex\n # Escape regex metacharacters, turn '*' into '.*', and anchor the pattern so\n # it matches a full label rather than a substring.\n regex=$(printf '%s' \"$service\" | sed -e 's/[][(){}.^$+?|\\\\]/\\\\&/g' -e 's/\\*/.*/g')\n regex=\"^${regex}$\"\n services=()\n local id\n # Match every loaded job by label regardless of PID; launchctl list reports\n # loaded-but-not-running jobs with a \"-\" in the PID column.\n while read -r _ _ id; do\n [[ \"$id\" =~ $regex ]] && services+=(\"$id\")\n done < <(launchctl list 2>/dev/null | tail -n +2)\n if [[ ${#services[@]} -eq 0 ]]; then\n echo \"No loaded launchctl service matches ${service}\"\n return\n fi\n fi\n\n local service_label\n for service_label in \"${services[@]}\"; do\n for should_sudo in \"${booleans[@]}\"; do\n plist_status=$(launchctl list \"${service_label}\" 2>/dev/null)\n\n if [[ $plist_status == \\{* ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo launchctl remove \"${service_label}\"\n else\n launchctl remove \"${service_label}\"\n fi\n sleep 1\n fi\n\n paths=(\n \"/Library/LaunchAgents/${service_label}.plist\"\n \"/Library/LaunchDaemons/${service_label}.plist\"\n )\n\n # if not using sudo, prepend the home directory to the paths\n if [[ $should_sudo == \"false\" ]]; then\n for i in \"${!paths[@]}\"; do\n paths[i]=\"${HOME}${paths[i]}\"\n done\n fi\n\n for path in \"${paths[@]}\"; do\n if [[ -e \"$path\" ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo rm -f -- \"$path\"\n else\n rm -f -- \"$path\"\n fi\n fi\n done\n done\n done\n}\n\nremove_pkg_files() {\n local PKGID=\"$1\"\n expand_pkgid_and_map \"$PKGID\" remove_receipt_files\n}\n\nremove_receipt_files() {\n local PKGID=\"$1\"\n local PKGINFO VOLUME INSTALL_LOCATION FULL_INSTALL_LOCATION\n\n echo \"pkgutil --pkg-info-plist \\\"$PKGID\\\"\"\n PKGINFO=$(pkgutil --pkg-info-plist \"$PKGID\")\n VOLUME=$(echo \"$PKGINFO\" | awk '/<key>volume<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n INSTALL_LOCATION=$(echo \"$PKGINFO\" | awk '/<key>install-location<\\/key>/ {getline; gsub(/.*<string>|<\\/string>.*/, \"\"); print}')\n\n if [ -z \"$INSTALL_LOCATION\" ] || [ \"$INSTALL_LOCATION\" = \"/\" ]; then\n FULL_INSTALL_LOCATION=\"$VOLUME\"\n else\n FULL_INSTALL_LOCATION=\"$VOLUME/$INSTALL_LOCATION\"\n FULL_INSTALL_LOCATION=$(echo \"$FULL_INSTALL_LOCATION\" | sed 's|//|/|g')\n fi\n\n echo \"sudo pkgutil --only-files --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-files --files \"$PKGID\" | sed \"s|^|/${INSTALL_LOCATION}/|\" | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n echo \"sudo pkgutil --only-dirs --files \\\"$PKGID\\\" | sed \\\"s|^|${FULL_INSTALL_LOCATION}/|\\\" | grep '\\\\.app$' | tr '\\\\\\\\n' '\\\\\\\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\"\n sudo pkgutil --only-dirs --files \"$PKGID\" | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" | grep '\\.app$' | tr '\\n' '\\0' | /usr/bin/sudo -u root -E -- /usr/bin/xargs -0 -- /bin/rm -rf\n\n root_app_dir=$(\n sudo pkgutil --only-dirs --files \"$PKGID\" \\\n | sed \"s|^|${FULL_INSTALL_LOCATION}/|\" \\\n | grep 'Applications' \\\n | awk '{ print length, $0 }' \\\n | sort -n \\\n | head -n1 \\\n | cut -d' ' -f2-\n )\n if [ -n \"$root_app_dir\" ]; then\n echo \"sudo rmdir -p \\\"$root_app_dir\\\" 2>/dev/null || :\"\n sudo rmdir -p \"$root_app_dir\" 2>/dev/null || :\n fi\n}\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nremove_launchctl_service 'com.citrix.AuthManager_Mac'\nremove_launchctl_service 'com.citrix.ctxusbd'\nremove_launchctl_service 'com.citrix.CtxWorkspaceHelperDaemon'\nremove_launchctl_service 'com.citrix.ctxworkspaceupdater'\nremove_launchctl_service 'com.citrix.devicetrust.launchagent'\nremove_launchctl_service 'com.citrix.PluginBroker'\nremove_launchctl_service 'com.citrix.ReceiverHelper'\nremove_launchctl_service 'com.citrix.ReceiverUninstallHelper'\nremove_launchctl_service 'com.citrix.ReceiverUpdaterHelper'\nremove_launchctl_service 'com.citrix.safariadapter'\nremove_launchctl_service 'com.citrix.ServiceRecords'\nremove_launchctl_service 'com.citrix.UninstallMonitor'\nquit_application 'Citrix.ServiceRecords'\nquit_application 'com.citrix.CitrixReceiverLauncher'\nquit_application 'com.citrix.receiver.nomas'\nquit_application 'com.citrix.ReceiverHelper'\nremove_pkg_files 'com.citrix.common'\nforget_pkg 'com.citrix.common'\nremove_pkg_files 'com.citrix.devicetrust.client'\nforget_pkg 'com.citrix.devicetrust.client'\nremove_pkg_files 'com.citrix.devicetrust.client.ica'\nforget_pkg 'com.citrix.devicetrust.client.ica'\nremove_pkg_files 'com.citrix.enterprisebrowserinstaller'\nforget_pkg 'com.citrix.enterprisebrowserinstaller'\nremove_pkg_files 'com.citrix.ICAClient'\nforget_pkg 'com.citrix.ICAClient'\nremove_pkg_files 'com.citrix.ICAClientcwa'\nforget_pkg 'com.citrix.ICAClientcwa'\nremove_pkg_files 'com.citrix.ICAClienthdx'\nforget_pkg 'com.citrix.ICAClienthdx'\nremove_pkg_files 'com.citrix.receiver.bcr'\nforget_pkg 'com.citrix.receiver.bcr'\nsudo rm -rf '/Applications/Citrix Workspace.app'\nsudo rm -rf '/Library/Citrix Workspace'\ntrash $LOGGED_IN_USER '/Library/Logs/Citrix Workspace'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Citrix Receiver'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Citrix Workspace'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Citrix'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.CitrixReceiverLauncher'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.HdxRtcEngine'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.receiver*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.citrix.ReceiverUpdater'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.citrix.receiver*'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.citrix.CitrixReceiverLauncher'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.citrix.receiver*'\ntrash $LOGGED_IN_USER '~/Library/Logs/Citrix Workspace'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.AuthManager.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.CitrixReceiverLauncher.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.HdxRtcEngine.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.receiver*.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.citrix.Receiver*.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.citrix.receiver.nomas.savedState'\ntrash $LOGGED_IN_USER '~/Library/WebKit/com.citrix.receiver.nomas'\n"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 8 \
  'INSTALLER_PATH|UninstallScript|uninstall_script_ref|exec.*script|sudo -u|run.*root' \
  ee/maintained-apps cmd/maintained-apps

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== candidate Go files =="
git ls-files 'cmd/maintained-apps/**/*.go' 'ee/maintained-apps/**/*.go' | sed -n '1,120p'

echo "== direct references to uninstall_script_ref and script refs =="
rg -n "uninstall_script_ref|install_script_ref|script_ref|INSTALLER_PATH|exec\\(|Run.*Install|Run.*Uninstall|Priv[ilege]|root|sudo" cmd/maintained-apps ee/maintained-apps --glob '!**/*.json' --glob '!**/outputs/**' || true

Repository: fleetdm/fleet

Length of output: 50369


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== all exact uninstall_script_ref occurrences outside outputs =="
rg -n --no-text --glob '!ee/maintained-apps/outputs/**/*.json' 'uninstall_script_ref' .

echo "== exact Citrix uninstall script path and script diff context =="
sed -n '1,240p' ee/maintained-apps/script-diff.sh
sed -n '1,110p' ee/maintained-apps/ingesters/homebrew/scripts.go | sed -n '220,340p'
sed -n '220,340p' ee/maintained-apps/ingesters/homebrew/scripts.go

Repository: fleetdm/fleet

Length of output: 7938


🌐 Web query:

Apple Homebrew install.sh uninstall.sh maintained apps sudo execution uninstall scripts

💡 Result:

Homebrew and its associated scripts, including install.sh and uninstall.sh, are not maintained by Apple; they are maintained by the Homebrew project [1][2]. Apple does not provide or support these scripts [3]. The official way to uninstall Homebrew is by using the uninstall.sh script provided by the Homebrew project [4][2]. This script is available in the Homebrew/install repository on GitHub [1][2]. Regarding sudo execution: - The Homebrew installation script is designed to install Homebrew to a default, supported prefix (/opt/homebrew on Apple Silicon or /usr/local on Intel) specifically so that you do not need to use sudo for day-to-day operations like running brew install [3]. - During installation, the script may prompt for sudo access to configure system directories (such as /etc/paths.d/homebrew) [5][3]. - The uninstall script itself may also require elevated permissions depending on the system configuration and the files it needs to remove [6]. You should always verify the source of these scripts by ensuring they originate from the official Homebrew/install repository [1][2]. Detailed documentation and instructions are available on the official Homebrew website [4][3].

Citations:


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== files containing uninstall.sh execution =="
rg -n "uninstall\.sh|install\.sh|exec.*maintained|maintained.*exec|fleetctl|agent|InstallScriptRef|UninstallScriptRef|InstallScriptPath|UninstallScriptPath|root|exec.*sudo|Env\\(.*App" -g '*.go' .

echo "== focused search in fleet packages and cmd =="
rg -n "installer|installer_tool|install_path|uninstall_path|uninstall_script|install_script" --glob '*.go' fleetdm cmd pkg .

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== maintainer README around script execution and sudo =="
sed -n '1,180p' ee/maintained-apps/README.md

echo "== service/model uninstall script references =="
sed -n '1,120p' server/service/maintained_apps.go
rg -n "uninstall_script|install_script|SoftwarePackage|InstallerPath|root|exec.Command|Cmd\\(" fleetdm cmd pkg pkg/file server/service --glob '*.go' | sed -n '1,220p'

echo "== focused file candidates likely executing installers/scripts =="
git ls-files 'pkg/**' 'fleetdm/**' 'cmd/maintained-apps/**' | awk 'length <= 220' | sed -n '1,300p' | rg -n "installer|script|maintained|install|run|cmd|exec|root|sudo" || true

Repository: fleetdm/fleet

Length of output: 46994


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== package execution files by exact identifiers =="
for f in \
  pkg/file/file.go \
  server/mdm/maintainedapps/*.go \
  server/mdm/*.go \
  orbit/*.go \
  cmd/maintained-apps/main.go \
  cmd/maintained-apps/main_test.go
do
  [ -f "$f" ] && { echo "--- $f"; sed -n '200,280p' "$f"; }
done

echo "== software installer model field =="
rg -n -C 3 "type SoftwarePackage|SoftwareInstaller|UninstallScript|InstallScript|InstallerPath|SoftwarePackage.*struct" server/fleet server/mdm server/service --glob '*.go' | sed -n '1,220p'

Repository: fleetdm/fleet

Length of output: 30085


Use privileged removal for /Library/Logs/Citrix Workspace.

trash moves its targets with plain mv; this path is not readable/writable by standard users, so the uninstall leaves the system log directory unless trash handles it with elevated removal or the move is executed with sudo.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ee/maintained-apps/outputs/citrix-workspace/darwin.json` at line 20, Update
the Citrix Workspace log cleanup call using trash so /Library/Logs/Citrix
Workspace is moved with elevated privileges. Extend trash to support privileged
moves or add a dedicated sudo path for this target, while preserving the
existing unprivileged behavior for user-library paths.

Comment on lines +4 to +12
"version": "7.0.8",
"queries": {
"exists": "SELECT 1 FROM apps WHERE bundle_identifier = 'com.coteditor.CotEditor';",
"patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'com.coteditor.CotEditor' AND version_compare(bundle_short_version, '7.0.7') < 0);"
"patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'com.coteditor.CotEditor' AND version_compare(bundle_short_version, '7.0.8') < 0);"
},
"installer_url": "https://github.com/coteditor/CotEditor/releases/download/7.0.7/CotEditor_7.0.7.dmg",
"installer_url": "https://github.com/coteditor/CotEditor/releases/download/7.0.8/CotEditor_7.0.8.dmg",
"install_script_ref": "d7df556c",
"uninstall_script_ref": "b4411f31",
"sha256": "353997fdf989085a7a02e67fe5e3517c2b594c44c9a93102d4c017fcfc4b84b0",
"sha256": "d065d99178f15df2a146eaba5b98de95e6ad4437802d9e8a62d61033fdc0ff90",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

rg -n -C 6 \
  'com\.coteditor\.CotEditor|minimum.*(os|version)|macOS 14|macOS 15|darwin' \
  cmd/maintained-apps ee/maintained-apps

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== coteditor manifest =="
cat -n ee/maintained-apps/outputs/coteditor/darwin.json

echo
echo "== coteditor references in managed-app code =="
rg -n -C 4 'coteditor|CotEditor|com\.coteditor\.CotEditor|minimum.*os|minimum.*version|min_macos|macos.*minimum|darwin' cmd ee/maintained-apps/schema ee/maintained-apps/docs 2>/dev/null || true

echo
echo "== generated CotEditor app entry =="
python3 - <<'PY'
import json
with open('ee/maintained-apps/outputs/apps.json') as f:
    data=json.load(f)
for app in data:
    if app.get('unique_identifier') == 'com.coteditor.CotEditor' or app.get('slug') == 'coteditor/darwin':
        import pprint
        pprint.pprint(app)
PY

Repository: fleetdm/fleet

Length of output: 50372


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== search exact keys and coteditor apps entries =="
python3 - <<'PY'
import json, glob, os, re
for path in sorted(glob.glob('ee/maintained-apps/outputs/coteditor/*.json')):
    print(f'-- {path} --')
    with open(path) as f:
        data=json.load(f)
    print(json.dumps(data, indent=2))

print('\n-- CotEditor generated entries --')
with open('ee/maintained-apps/outputs/apps.json') as f:
    apps=json.load(f)
for i, app in enumerate(apps):
    if app.get('unique_identifier') == 'com.coteditor.CotEditor' or app.get('slug') == 'coteditor/darwin':
        print(i, json.dumps(app, indent=2))

print('\n-- Key presence in coteditor manifest --')
with open('ee/maintained-apps/outputs/coteditor/darwin.json') as f:
    data=json.load(f)
for key in ['minimum_os', 'minimum_version', 'min_os', 'macos_compatibility', 'os']:
    print(key, 'present=', key in data, 'value=', data.get(key))
PY

echo
echo "== file names with min_os or minimum_os =="
python3 - <<'PY'
import json,glob
def check(p):
    try:
        with open(p) as f:
            d=json.load(f)
    except:
        return
    if 'minimum_os' in d or 'min_os' in d or 'macos_compatibility' in d or 'os' in d:
        print(p)
for p in glob.glob('ee/maintained-apps/outputs/**/*.json', recursive=True):
    check(p)
PY

Repository: fleetdm/fleet

Length of output: 9078


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== apps.json CotEditor lines =="
python3 - <<'PY'
from pathlib import Path
p = Path('ee/maintained-apps/outputs/apps.json')
text = p.read_text()
for term in ['com.coteditor.CotEditor', 'coteditor/darwin']:
    idx = text.find(term)
    start = max(0, text.rfind('\n', 0, idx - 500))
    end = text.find('\n', idx + 500)
    print(f'-- {term} --')
    print('\n'.join(f'{i+1}\t{line}' for i, line in enumerate(text[start:end].splitlines(), start=start + 1))[:3000])
PY

echo
echo "== installed_app/model availability fields/text =="
rg -n -C 3 'MinimumOS|minimum_os|min_os|OSVersion|os_version|osQueryTable|installed_apps|fleetctl.+app|MaintainedApp|apps.go|maintained' cmd ee 2>/dev/null | head -n 300 || true

Repository: fleetdm/fleet

Length of output: 23742


🏁 Script executed:

#!/usr/bin/env bash
set -euo pipefail

echo "== maintaned apps manifest struct =="
sed -n '1,220p' ee/maintained-apps/maintained_apps.go

echo
echo "== FMA app installer processing =="
rg -n -C 5 'FMAManifestFile|installer_url|install_script_ref|install_script|installerURL|InstallerURL|MinimumOS|minimum_os|min_os|os_version|system_info' cmd ee -g '*.go' -g '*.json' | head -n 400 || true

echo
echo "== MaintainedApp model availability =="
rg -n -C 4 'type MaintainedApp struct|MinimumOS|Minimum.*OS|Platform|InstallerURL|InstallScript' ee server cmd -g '*.go' | head -n 400 || true

Repository: fleetdm/fleet

Length of output: 50369


🌐 Web query:

CotEditor 7.0.8 macOS 15 requirement macOS 14 compatibility

💡 Result:

CotEditor 7.0.8 requires macOS 15 or later [1][2][3]. It is not compatible with macOS 14 (Sonoma) [1][4]. The CotEditor project maintains a policy of supporting only the latest two major macOS releases [4]. Because CotEditor 7.x series is built to support macOS 15 and later, users running macOS 14 Sonoma should use CotEditor 5.2.3, which is the final version released specifically for that operating system [1]. Older versions are available via the official CotEditor archives [1][4].

Citations:


Block macOS 14 hosts from deploying CotEditor 7.0.8.

CotEditor 7.0.8 requires macOS 15, but this manifest has no minimum macOS constraint and the installer only copies the DMG contents to /Applications/CotEditor.app. macOS 14 hosts in Fleet can still receive the app as compatible; add an explicit OS guard or keep a macOS-14-supported CotEditor version in the release stream.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ee/maintained-apps/outputs/coteditor/darwin.json` around lines 4 - 12, Update
the CotEditor manifest’s compatibility logic to prevent version 7.0.8 from
deploying on macOS 14 hosts. Add the repository’s established minimum-OS guard
for macOS 15, or adjust the release stream to retain a CotEditor version
supporting macOS 14; keep the existing version, installer, and query behavior
unchanged otherwise.

"patched": "SELECT 1 WHERE NOT EXISTS (SELECT 1 FROM apps WHERE bundle_identifier = 'dev.kiro.desktop' AND version_compare(bundle_short_version, '1.0.288') < 0);"
},
"installer_url": "https://prod.download.desktop.kiro.dev/releases/stable/darwin-arm64/signed/1.0.242/kiro-ide-1.0.242-stable-darwin-arm64.dmg",
"installer_url": "https://prod.download.desktop.kiro.dev/releases/stable/darwin-arm64/signed/1.0.288/kiro-ide-1.0.288-stable-darwin-arm64.dmg",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 8 'darwin-arm64|arm64|architecture|platform' ee/maintained-apps cmd/maintained-apps

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== target file =="
sed -n '1,80p' ee/maintained-apps/outputs/kiro/darwin.json

echo
echo "== kiro entries in apps.json =="
python3 - <<'PY'
import json
from pathlib import Path
data=json.loads(Path("ee/maintained-apps/outputs/apps.json").read_text())
for i,p in enumerate(data):
    if p.get("slug")=="kiro/darwin":
        print(f"index={i}")
        print(json.dumps(p, indent=2))
PY

echo
echo "== kiro maintained app sources =="
fd -a 'kiro|maintained' ee/maintained-apps | sed 's#^\./##' | head -120
fd -a '.*' ee/maintained-apps | git ls-files -z -- ':!ee/maintained-apps/outputs' | tr '\0' '\n' | rg -n 'kiro|maintained|darwin|architecture|platform|installer_url' || true

Repository: fleetdm/fleet

Length of output: 7405


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== kiro entries in apps.json =="
python3 - <<'PY'
import json
from pathlib import Path
data=json.loads(Path("ee/maintained-apps/outputs/apps.json").read_text())
for i,p in enumerate(data):
    if next(iter(p)) == "kiro/darwin":
        print(f"index={i}")
        print(json.dumps(p, indent=2))
        break
else:
    print("kiro/darwin not found")
PY

echo
echo "== maintained apps source files =="
git ls-files 'ee/maintained-apps/*' 'ee/maintained-apps/**' | sed -n '1,200p'

echo
echo "== kiro source references =="
rg -n -C 4 'kiro|Kiro|dev.kiro.desktop|darwin-arm64|installer_url|architecture|platform|slug' ee/maintained-apps cmd/maintained-apps | sed -n '1,240p'

Repository: fleetdm/fleet

Length of output: 28260


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== kee/darwin and kiro output/source paths =="
fd -a 'ke[eo]\|kiro|darwin\.json' ee/maintained-apps/outputs | sort | sed -n '1,200p'
fd -a '\.json$|ke[eo]\|kiro|^README\.md$' ee/maintained-apps/inputs | sort | sed -n '1,200p'

echo
echo "== references to Kiro/kiro/darwin-arm64 =="
rg -n -i 'kiro|ke[eo]|darwin-arm64|arm64' ee/maintained-apps cmd/maintained-apps | sed -n '1,240p'

Repository: fleetdm/fleet

Length of output: 50370


🏁 Script executed:

#!/bin/bash
set -euo pipefail
export LC_ALL=C

echo "== exact kiro/kee output and input files =="
git ls-files | rg '(^ee/maintained-apps/(inputs|outputs)/|\.json)$' | rg '(^ee/maintained-apps/outputs/kiro/|(^ee/maintained-apps/outputs/kee/)|(^ee/maintained-apps/inputs/.*kee|/.*kee.*\.json$)|(^ee/maintained-apps/inputs/.*kiro|/.*kiro.*\.json$))' || true

echo
echo "== kiro/kee references in repo =="
rg -n -i 'kiro|ke[eo]|darwin-arm64|arm64' . --glob '!ee/maintained-apps/outputs/**/*.dmg' --glob '!ee/maintained-apps/outputs/**/*.zip' --glob '!ee/maintained-apps/outputs/**/*.json' --glob '!node_modules/**' --glob '!vendor/**' | sed -n '1,240p'

echo
echo "== check apps.json kiro/kee slug entries =="
python3 - <<'PY'
import json
from pathlib import Path
p=Path("ee/maintained-apps/outputs/apps.json")
text=p.read_text(encoding="utf-8", errors="replace")
print("path exists", p.exists(), "size", len(text))
PY

Repository: fleetdm/fleet

Length of output: 35529


🌐 Web query:

Kiro desktop macOS kiro.dev documentation installation supports both Intel Apple silicon M1 M2 app

💡 Result:

Yes, the Kiro desktop application for macOS provides support for both Intel-based Macs and Apple Silicon (M1/M2) hardware [1]. According to the official documentation, the Kiro IDE supports macOS systems running on both Intel and Apple Silicon architectures [1]. When downloading the application from the official Kiro downloads page, you should select the version appropriate for your specific hardware architecture [2][3]. Using the incorrect version (e.g., the Apple Silicon version on an Intel-based Mac) will result in incompatibility [3]. If you encounter installation issues on macOS, such as security warnings stating the app is damaged or cannot be opened, the official troubleshooting guide recommends adjusting your security settings or running a quarantine removal command in the terminal to allow the application to launch [4]. Top_results: 1, 2, 3, 4

Citations:


Use an installer that covers the generic macOS target.

kiro/darwin points to a darwin-arm64 installer, but Kiro supports both Intel and Apple silicon macOS. Fleet selects this generic slug by platform, so Intel Macs receive an incompatible artifact. Use a universal macOS installer or document/restrict this slug to Apple silicon.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ee/maintained-apps/outputs/kiro/darwin.json` at line 9, Update the
installer_url in the darwin configuration to reference a universal macOS
installer rather than the darwin-arm64 artifact, so the generic darwin target
supports both Intel and Apple silicon Macs.

Source: MCP tools

],
"refs": {
"9db6b9b2": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nsudo rm -rf \"$APPDIR/MongoDB Compass.app\"\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.mongodb.compass.sfl*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Caches/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.mongodb.compass.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.mongodb.compass.savedState'\n",
"022cab65": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nquit_application 'com.mongodb.compass'\nsudo rm -rf \"$APPDIR/MongoDB Compass.app\"\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.mongodb.compass.sfl*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Caches/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.mongodb.compass.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.mongodb.compass.savedState'\n",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Abort the uninstall when Compass cannot be stopped.

At Line 19, quit_application logs a timeout or a missing GUI session but returns success. The caller then deletes the application bundle even when Compass may still be running.

Return a non-zero status from unsafe branches and stop the uninstall before sudo rm -rf.

🛠️ Propagate quit failure before deletion
   if [[ -z "$console_user" || "$console_user" == "root" || "$console_user" == "loginwindow" ]]; then
     echo "Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'."
-    return
+    return 1
   fi
...
   if [[ "$quit_success" = false ]]; then
     echo "Application '$bundle_id' did not quit."
+    return 1
   fi
 }
 
-quit_application 'com.mongodb.compass'
+if ! quit_application 'com.mongodb.compass'; then
+  exit 1
+fi
 sudo rm -rf "$APPDIR/MongoDB Compass.app"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"022cab65": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n fi\n}\n\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nquit_application 'com.mongodb.compass'\nsudo rm -rf \"$APPDIR/MongoDB Compass.app\"\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.mongodb.compass.sfl*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Caches/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.mongodb.compass.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.mongodb.compass.savedState'\n",
"022cab65": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n local app_running\n app_running=$(osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null)\n if [[ \"$app_running\" != \"true\" ]]; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ -z \"$console_user\" || \"$console_user\" == \"root\" || \"$console_user\" == \"loginwindow\" ]]; then\n echo \"Not logged into a non-root GUI; skipping quitting application ID '$bundle_id'.\"\n return 1\n fi\n\n echo \"Quitting application '$bundle_id'...\"\n\n # try to quit the application within the timeout period\n local quit_success=false\n SECONDS=0\n while (( SECONDS < timeout_duration )); do\n if osascript -e \"tell application id \\\"$bundle_id\\\" to quit\" >/dev/null 2>&1; then\n if ! pgrep -f \"$bundle_id\" >/dev/null 2>&1; then\n echo \"Application '$bundle_id' quit successfully.\"\n quit_success=true\n break\n fi\n fi\n sleep 1\n done\n\n if [[ \"$quit_success\" = false ]]; then\n echo \"Application '$bundle_id' did not quit.\"\n return 1\n fi\n}\n\n\ntrash() {\n local logged_in_user=\"$1\"\n local target_file=\"$2\"\n local timestamp=\"$(date +%Y-%m-%d-%s)\"\n local rand=\"$(jot -r 1 0 99999)\"\n\n # replace ~ with /Users/$logged_in_user\n if [[ \"$target_file\" == ~* ]]; then\n target_file=\"/Users/$logged_in_user${target_file:1}\"\n fi\n\n local trash=\"/Users/$logged_in_user/.Trash\"\n\n # If the target contains glob characters, expand it and move each match.\n if [[ \"$target_file\" == *[*?[]* ]]; then\n local file file_name\n local matched=false\n local i=0\n # compgen -G expands the (quoted) pattern itself, so paths containing\n # spaces glob correctly; reading line by line keeps each match intact.\n while IFS= read -r file; do\n [[ -n \"$file\" ]] || continue\n [[ -e \"$file\" || -L \"$file\" ]] || continue\n matched=true\n i=$((i + 1))\n file_name=\"$(basename \"$file\")\"\n echo \"removing $file.\"\n # The per-match counter keeps matches that share a basename from\n # overwriting each other in the trash.\n mv -f \"$file\" \"$trash/${file_name}_${timestamp}_${rand}_${i}\"\n done < <(compgen -G \"$target_file\" 2>/dev/null)\n if [[ \"$matched\" == false ]]; then\n echo \"$target_file doesn't exist.\"\n fi\n return\n fi\n\n local file_name=\"$(basename \"${target_file}\")\"\n\n if [[ -e \"$target_file\" ]]; then\n echo \"removing $target_file.\"\n mv -f \"$target_file\" \"$trash/${file_name}_${timestamp}_${rand}\"\n else\n echo \"$target_file doesn't exist.\"\n fi\n}\n\nif ! quit_application 'com.mongodb.compass'; then\n exit 1\nfi\nsudo rm -rf \"$APPDIR/MongoDB Compass.app\"\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.mongodb.compass.sfl*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Caches/MongoDB Compass'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.mongodb.compass.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.mongodb.compass.savedState'\n",
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ee/maintained-apps/outputs/mongodb-compass/darwin.json` at line 19, Update
quit_application to return a non-zero status when Compass is still running after
the timeout or when no valid non-root GUI session is available; preserve success
only when the application is confirmed stopped or was not running. At the
caller, check quit_application's result and exit before sudo rm -rf and
subsequent trash calls when it fails.

@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Closing in favor of #50781.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants