Update Fleet-maintained apps - #46267
Conversation
Generated automatically with cmd/maintained-apps.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
Script Diff Resultsee/maintained-apps/outputs/1password/darwin.json=== Install Script (no changes) ===
=== Uninstall // f58c31b3 -> dadf8c51 ===
--- /tmp/old.ka0tBZ 2026-05-27 17:04:12.190250782 +0000
+++ /tmp/new.d497U7 2026-05-27 17:04:12.190250782 +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"
@@ -27,6 +67,7 @@
fi
}
+quit_application 'com.1password.1password'
sudo rm -rf "$APPDIR/1Password.app"
trash $LOGGED_IN_USER '~/Library/Application Scripts/2BUA8C4S2C.com.1password*'
trash $LOGGED_IN_USER '~/Library/Application Scripts/2BUA8C4S2C.com.agilebits'ee/maintained-apps/outputs/dropbox/darwin.json=== Install Script (no changes) ===
=== Uninstall // 4d5c7d9c -> f2e8d2ab ===
--- /tmp/old.eemNej 2026-05-27 17:04:12.241250715 +0000
+++ /tmp/new.PZy9Xv 2026-05-27 17:04:12.241250715 +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
+}
+
+
remove_launchctl_service() {
local service="$1"
local booleans=("true" "false")
@@ -73,6 +113,7 @@
}
remove_launchctl_service 'com.dropbox.DropboxMacUpdate.agent'
+quit_application 'com.getdropbox.dropbox'
sudo rm -rf '/Library/DropboxHelperTools'
sudo rm -rf '/Library/Preferences/com.getdropbox.dropbox.dbkextd.plist'
sudo rm -rf "$APPDIR/Dropbox.app"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/jabra-direct/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) === |
WalkthroughThis PR updates configuration for six maintained applications in Fleet's managed software catalog. Two applications receive enhanced uninstall scripts: 1Password's macOS uninstall now quits the app before removal using AppleScript with console-user detection, and Dropbox's uninstall introduces a Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
ee/maintained-apps/outputs/1password/darwin.json (1)
19-19: 💤 Low valueQuote
$LOGGED_IN_USERintrashcalls for robustness.The calls to
trashuse unquoted$LOGGED_IN_USER:trash $LOGGED_IN_USER '~/Library/...'. While macOS usernames typically don't contain spaces, quoting the variable is a defensive best practice.Suggested pattern
-trash $LOGGED_IN_USER '~/Library/Application Support/1Password' +trash "$LOGGED_IN_USER" '~/Library/Application Support/1Password'🤖 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/1password/darwin.json` at line 19, The pull request uses unquoted expansion of LOGGED_IN_USER in calls to the trash function (e.g., lines invoking trash $LOGGED_IN_USER '~/Library/...'), which can break if a username contains spaces; update every invocation of the trash function to quote the variable when passing it (use "$LOGGED_IN_USER" as the first argument) while leaving the target path strings quoted as-is, ensuring the change is applied to all calls to trash in this file and leaving the trash() function signature unchanged.
🤖 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/1password/darwin.json`:
- Line 19: The trash calls are passing glob patterns quoted (e.g., in calls that
reference patterns like '2BUA8C4S2C.com.1password*') so the current trash()
(which tests [[ -e "$target_file" ]]) never expands them; either expand globs at
call sites or make trash() handle globs: update calls that invoke trash (where
LOGGED_IN_USER and patterns like '~/Library/...*' are used) to loop over
shell-expanded paths and call trash for each match, or modify trash() to detect
glob patterns and iterate matches internally (use compgen -G or a for loop to
enumerate matches, preserve ~ → /Users/$logged_in_user expansion, and only mv
existing matches to the user .Trash).
In `@ee/maintained-apps/outputs/dropbox/darwin.json`:
- Line 20: The trash function is treating glob patterns (e.g. calls like trash
$LOGGED_IN_USER '~/Library/Application Scripts/*.com.getdropbox.dropbox.sync'
and '~/Library/Group Containers/*.com.getdropbox.dropbox.sync') as literal
filenames, so asterisks are never expanded; update the trash() function to
expand globs and handle multiple matches: after you perform the ~ ->
/Users/$logged_in_user replacement inside trash(), detect if the target_file
contains glob chars (like '*') and iterate over the expanded matches (for match
in $target_file; do if [[ -e "$match" ]]; then mv -f "$match" "$trash/$(basename
"$match")_${timestamp}_${rand}" fi done), and ensure you enable safe behavior
when no matches exist (use shopt -s nullglob before expansion and restore it
after, or perform a fallback check) so wildcarded paths are actually removed for
functions like trash and the existing non-glob behavior remains unchanged.
---
Nitpick comments:
In `@ee/maintained-apps/outputs/1password/darwin.json`:
- Line 19: The pull request uses unquoted expansion of LOGGED_IN_USER in calls
to the trash function (e.g., lines invoking trash $LOGGED_IN_USER
'~/Library/...'), which can break if a username contains spaces; update every
invocation of the trash function to quote the variable when passing it (use
"$LOGGED_IN_USER" as the first argument) while leaving the target path strings
quoted as-is, ensuring the change is applied to all calls to trash in this file
and leaving the trash() function signature unchanged.
🪄 Autofix (Beta)
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
Run ID: 59aa81c2-5bd2-4ef2-b9c6-7db4fce63012
📒 Files selected for processing (6)
ee/maintained-apps/outputs/1password/darwin.jsonee/maintained-apps/outputs/dropbox/darwin.jsonee/maintained-apps/outputs/granola/darwin.jsonee/maintained-apps/outputs/granola/windows.jsonee/maintained-apps/outputs/jabra-direct/darwin.jsonee/maintained-apps/outputs/whatsapp/darwin.json
| "refs": { | ||
| "ef2a17ff": "#!/bin/bash\n\nquit_application() {\n local bundle_id=\"$1\"\n local timeout_duration=10\n\n # check if the application is running\n if ! osascript -e \"application id \\\"$bundle_id\\\" is running\" 2>/dev/null; then\n return\n fi\n\n local console_user\n console_user=$(stat -f \"%Su\" /dev/console)\n if [[ $EUID -eq 0 && \"$console_user\" == \"root\" ]]; 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\nquit_application 'com.1password.1password'\ninstaller -pkg \"$INSTALLER_PATH\" -target /\n\n", | ||
| "f58c31b3": "#!/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 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/1Password.app\"\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/2BUA8C4S2C.com.1password*'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/2BUA8C4S2C.com.agilebits'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.1password.1password-launcher'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.1password.browser-support'\ntrash $LOGGED_IN_USER '~/Library/Application Support/1Password'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Arc/User Data/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.1password.1password.sfl*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/CrashReporter/1Password*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome Beta/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome Canary/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome Dev/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge Beta/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge Canary/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge Dev/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Mozilla/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Vivaldi/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Containers/2BUA8C4S2C.com.1password.browser-helper'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.1password.1password*'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.1password.browser-support'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/2BUA8C4S2C.com.1password'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/2BUA8C4S2C.com.agilebits'\ntrash $LOGGED_IN_USER '~/Library/Logs/1Password'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.1password.1password.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/group.com.1password.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.1password.1password.savedState'\n" | ||
| "dadf8c51": "#!/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 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.1password.1password'\nsudo rm -rf \"$APPDIR/1Password.app\"\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/2BUA8C4S2C.com.1password*'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/2BUA8C4S2C.com.agilebits'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.1password.1password-launcher'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.1password.browser-support'\ntrash $LOGGED_IN_USER '~/Library/Application Support/1Password'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Arc/User Data/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.1password.1password.sfl*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/CrashReporter/1Password*'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome Beta/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome Canary/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome Dev/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Google/Chrome/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge Beta/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge Canary/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge Dev/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Microsoft Edge/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Mozilla/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Vivaldi/NativeMessagingHosts/com.1password.1password.json'\ntrash $LOGGED_IN_USER '~/Library/Containers/2BUA8C4S2C.com.1password.browser-helper'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.1password.1password*'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.1password.browser-support'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/2BUA8C4S2C.com.1password'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/2BUA8C4S2C.com.agilebits'\ntrash $LOGGED_IN_USER '~/Library/Logs/1Password'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.1password.1password.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/group.com.1password.plist'\ntrash $LOGGED_IN_USER '~/Library/Saved Application State/com.1password.1password.savedState'\n", |
There was a problem hiding this comment.
Glob patterns in trash calls will not be expanded.
The trash function uses [[ -e "$target_file" ]] to check file existence, but bash's [[ -e ]] test does not expand glob patterns when the path is double-quoted. Paths containing wildcards like 2BUA8C4S2C.com.1password* and com.1password.1password* will fail to match and those files/directories won't be cleaned up.
To handle globs, iterate over matched paths before calling trash:
# Instead of:
trash $LOGGED_IN_USER '~/Library/Application Scripts/2BUA8C4S2C.com.1password*'
# Use:
for f in /Users/"$LOGGED_IN_USER"/Library/Application\ Scripts/2BUA8C4S2C.com.1password*; do
[[ -e "$f" ]] && trash "$LOGGED_IN_USER" "$f"
doneAlternatively, modify the trash function to handle glob expansion internally using compgen -G or a for loop.
🤖 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/1password/darwin.json` at line 19, The trash calls
are passing glob patterns quoted (e.g., in calls that reference patterns like
'2BUA8C4S2C.com.1password*') so the current trash() (which tests [[ -e
"$target_file" ]]) never expands them; either expand globs at call sites or make
trash() handle globs: update calls that invoke trash (where LOGGED_IN_USER and
patterns like '~/Library/...*' are used) to loop over shell-expanded paths and
call trash for each match, or modify trash() to detect glob patterns and iterate
matches internally (use compgen -G or a for loop to enumerate matches, preserve
~ → /Users/$logged_in_user expansion, and only mv existing matches to the user
.Trash).
| "4d5c7d9c": "#!/bin/bash\n\n# variables\nAPPDIR=\"/Applications/\"\nLOGGED_IN_USER=$(scutil <<< \"show State:/Users/ConsoleUser\" | awk '/Name :/ { print $3 }')\n# functions\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 for should_sudo in \"${booleans[@]}\"; do\n plist_status=$(launchctl list \"${service}\" 2>/dev/null)\n\n if [[ $plist_status == \\{* ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo launchctl remove \"${service}\"\n else\n launchctl remove \"${service}\"\n fi\n sleep 1\n fi\n\n paths=(\n \"/Library/LaunchAgents/${service}.plist\"\n \"/Library/LaunchDaemons/${service}.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}\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 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.dropbox.DropboxMacUpdate.agent'\nsudo rm -rf '/Library/DropboxHelperTools'\nsudo rm -rf '/Library/Preferences/com.getdropbox.dropbox.dbkextd.plist'\nsudo rm -rf \"$APPDIR/Dropbox.app\"\ntrash $LOGGED_IN_USER '~/.dropbox'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/*.com.getdropbox.dropbox.sync'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.dropbox.alternatenotificationservice'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.dropbox.client.crashpad'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.dropbox.foldertagger'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.getdropbox.dropbox.garcon'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.getdropbox.dropbox.TransferExtension'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Application Support/DropboxElectron'\ntrash $LOGGED_IN_USER '~/Library/Application Support/FileProvider/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Caches/CloudKit/com.apple.bird/iCloud.com.getdropbox.Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.dropbox.DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.dropbox.DropboxUpdater'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.getdropbox.dropbox'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.getdropbox.DropboxMetaInstaller'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.plausiblelabs.crashreporter.data/com.dropbox.DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/CloudStorage/Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.dropbox.activityprovider'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.dropbox.alternatenotificationservice'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.dropbox.foldertagger'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.getdropbox.dropbox.garcon'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.getdropbox.dropbox.TransferExtension'\ntrash $LOGGED_IN_USER '~/Library/Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Dropbox/DropboxMacUpdate.app/Contents/MacOS/DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/*.com.getdropbox.dropbox.sync'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/com.dropbox.client.crashpad'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/com.getdropbox.dropbox.garcon'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.dropbox.DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.getdropbox.dropbox'\ntrash $LOGGED_IN_USER '~/Library/LaunchAgents/com.dropbox.DropboxMacUpdate.agent.plist'\ntrash $LOGGED_IN_USER '~/Library/Logs/Dropbox_debug.log'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.apple.FileProvider/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.dropbox.DropboxMacUpdate.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.dropbox.DropboxMonitor.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.dropbox.tungsten.helper.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.getdropbox.dropbox.plist'\n", | ||
| "59c04bcb": "#!/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# extract contents\nMOUNT_POINT=$(mktemp -d /tmp/dmg_mount_XXXXXX)\nhdiutil attach -plist -nobrowse -readonly -mountpoint \"$MOUNT_POINT\" \"$INSTALLER_PATH\"\nsudo cp -R \"$MOUNT_POINT\"/* \"$TMPDIR\"\nhdiutil detach \"$MOUNT_POINT\"\n# copy to the applications folder\nquit_and_track_application 'com.getdropbox.dropbox'\nif [ -d \"$APPDIR/Dropbox.app\" ]; then\n\tsudo mv \"$APPDIR/Dropbox.app\" \"$TMPDIR/Dropbox.app.bkp\"\nfi\nsudo cp -R \"$TMPDIR/Dropbox.app\" \"$APPDIR\"\nrelaunch_application 'com.getdropbox.dropbox'\n" | ||
| "59c04bcb": "#!/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# extract contents\nMOUNT_POINT=$(mktemp -d /tmp/dmg_mount_XXXXXX)\nhdiutil attach -plist -nobrowse -readonly -mountpoint \"$MOUNT_POINT\" \"$INSTALLER_PATH\"\nsudo cp -R \"$MOUNT_POINT\"/* \"$TMPDIR\"\nhdiutil detach \"$MOUNT_POINT\"\n# copy to the applications folder\nquit_and_track_application 'com.getdropbox.dropbox'\nif [ -d \"$APPDIR/Dropbox.app\" ]; then\n\tsudo mv \"$APPDIR/Dropbox.app\" \"$TMPDIR/Dropbox.app.bkp\"\nfi\nsudo cp -R \"$TMPDIR/Dropbox.app\" \"$APPDIR\"\nrelaunch_application 'com.getdropbox.dropbox'\n", | ||
| "f2e8d2ab": "#!/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\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 for should_sudo in \"${booleans[@]}\"; do\n plist_status=$(launchctl list \"${service}\" 2>/dev/null)\n\n if [[ $plist_status == \\{* ]]; then\n if [[ $should_sudo == \"true\" ]]; then\n sudo launchctl remove \"${service}\"\n else\n launchctl remove \"${service}\"\n fi\n sleep 1\n fi\n\n paths=(\n \"/Library/LaunchAgents/${service}.plist\"\n \"/Library/LaunchDaemons/${service}.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}\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 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.dropbox.DropboxMacUpdate.agent'\nquit_application 'com.getdropbox.dropbox'\nsudo rm -rf '/Library/DropboxHelperTools'\nsudo rm -rf '/Library/Preferences/com.getdropbox.dropbox.dbkextd.plist'\nsudo rm -rf \"$APPDIR/Dropbox.app\"\ntrash $LOGGED_IN_USER '~/.dropbox'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/*.com.getdropbox.dropbox.sync'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.dropbox.alternatenotificationservice'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.dropbox.client.crashpad'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.dropbox.foldertagger'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.getdropbox.dropbox.garcon'\ntrash $LOGGED_IN_USER '~/Library/Application Scripts/com.getdropbox.dropbox.TransferExtension'\ntrash $LOGGED_IN_USER '~/Library/Application Support/Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Application Support/DropboxElectron'\ntrash $LOGGED_IN_USER '~/Library/Application Support/FileProvider/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Caches/CloudKit/com.apple.bird/iCloud.com.getdropbox.Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.dropbox.DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.dropbox.DropboxUpdater'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.getdropbox.dropbox'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.getdropbox.DropboxMetaInstaller'\ntrash $LOGGED_IN_USER '~/Library/Caches/com.plausiblelabs.crashreporter.data/com.dropbox.DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/CloudStorage/Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.dropbox.activityprovider'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.dropbox.alternatenotificationservice'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.dropbox.foldertagger'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.getdropbox.dropbox.garcon'\ntrash $LOGGED_IN_USER '~/Library/Containers/com.getdropbox.dropbox.TransferExtension'\ntrash $LOGGED_IN_USER '~/Library/Dropbox'\ntrash $LOGGED_IN_USER '~/Library/Dropbox/DropboxMacUpdate.app/Contents/MacOS/DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/*.com.getdropbox.dropbox.sync'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/com.dropbox.client.crashpad'\ntrash $LOGGED_IN_USER '~/Library/Group Containers/com.getdropbox.dropbox.garcon'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.dropbox.DropboxMacUpdate'\ntrash $LOGGED_IN_USER '~/Library/HTTPStorages/com.getdropbox.dropbox'\ntrash $LOGGED_IN_USER '~/Library/LaunchAgents/com.dropbox.DropboxMacUpdate.agent.plist'\ntrash $LOGGED_IN_USER '~/Library/Logs/Dropbox_debug.log'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.apple.FileProvider/com.getdropbox.dropbox.fileprovider'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.dropbox.DropboxMacUpdate.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.dropbox.DropboxMonitor.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.dropbox.tungsten.helper.plist'\ntrash $LOGGED_IN_USER '~/Library/Preferences/com.getdropbox.dropbox.plist'\n" |
There was a problem hiding this comment.
Same glob expansion issue affects Dropbox cleanup paths.
Identical to the 1Password script, glob patterns like *.com.getdropbox.dropbox.sync in these trash calls won't be expanded:
'~/Library/Application Scripts/*.com.getdropbox.dropbox.sync''~/Library/Group Containers/*.com.getdropbox.dropbox.sync'
The [[ -e "$target_file" ]] check treats the asterisk literally, so these directories won't be removed.
🤖 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/dropbox/darwin.json` at line 20, The trash
function is treating glob patterns (e.g. calls like trash $LOGGED_IN_USER
'~/Library/Application Scripts/*.com.getdropbox.dropbox.sync' and
'~/Library/Group Containers/*.com.getdropbox.dropbox.sync') as literal
filenames, so asterisks are never expanded; update the trash() function to
expand globs and handle multiple matches: after you perform the ~ ->
/Users/$logged_in_user replacement inside trash(), detect if the target_file
contains glob chars (like '*') and iterate over the expanded matches (for match
in $target_file; do if [[ -e "$match" ]]; then mv -f "$match" "$trash/$(basename
"$match")_${timestamp}_${rand}" fi done), and ensure you enable safe behavior
when no matches exist (use shopt -s nullglob before expansion and restore it
after, or perform a fallback check) so wildcarded paths are actually removed for
functions like trash and the existing non-glob behavior remains unchanged.
|
Closing in favor of #46275. |
Automated ingestion of latest Fleet-maintained app data.
Summary by CodeRabbit
Bug Fixes
Chores