mirror of
https://github.com/tw93/Mole.git
synced 2026-02-11 08:19:18 +00:00
chore: auto format code
This commit is contained in:
@@ -164,8 +164,8 @@ scan_installed_apps() {
|
||||
|
||||
(
|
||||
run_with_timeout 5 find ~/Library/LaunchAgents /Library/LaunchAgents \
|
||||
-name "*.plist" -type f 2> /dev/null |
|
||||
xargs -I {} basename {} .plist > "$scan_tmp_dir/agents.txt" 2> /dev/null || true
|
||||
-name "*.plist" -type f 2> /dev/null |
|
||||
xargs -I {} basename {} .plist > "$scan_tmp_dir/agents.txt" 2> /dev/null || true
|
||||
) &
|
||||
pids+=($!)
|
||||
|
||||
@@ -212,7 +212,6 @@ is_bundle_orphaned() {
|
||||
return 1
|
||||
fi
|
||||
|
||||
|
||||
# Extra check for specific system bundles not covered by patterns
|
||||
case "$bundle_id" in
|
||||
loginwindow | dock | systempreferences | finder | safari)
|
||||
|
||||
@@ -38,7 +38,7 @@ clean_orphaned_casks() {
|
||||
rm -f "$cask_cache" 2> /dev/null || true
|
||||
true > "$cask_cache"
|
||||
|
||||
while IFS= read -r cask; do
|
||||
while IFS= read -r cask; do
|
||||
# Get app path from cask info with timeout protection (expensive call, hence caching)
|
||||
local cask_info
|
||||
cask_info=$(run_with_timeout 10 brew info --cask "$cask" 2> /dev/null || true)
|
||||
@@ -62,12 +62,11 @@ clean_orphaned_casks() {
|
||||
# Check if app exists into common locations
|
||||
# We must check both /Applications and ~/Applications
|
||||
if [[ ! -e "/Applications/$app_name" ]] && [[ ! -e "$HOME/Applications/$app_name" ]]; then
|
||||
orphaned_casks+=("$cask")
|
||||
orphaned_casks+=("$cask")
|
||||
fi
|
||||
done < <(brew list --cask 2> /dev/null || true)
|
||||
fi
|
||||
|
||||
|
||||
# Remove orphaned casks if found and sudo session is still valid
|
||||
if [[ ${#orphaned_casks[@]} -gt 0 ]]; then
|
||||
# Check if sudo session is still valid (without prompting)
|
||||
|
||||
@@ -52,8 +52,6 @@ clean_deep_system() {
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Clean macOS Install Data (system upgrade leftovers)
|
||||
# Only remove if older than 30 days to ensure system stability
|
||||
if [[ -d "/macOS Install Data" ]]; then
|
||||
|
||||
Reference in New Issue
Block a user