diff --git a/bin/uninstall.sh b/bin/uninstall.sh index e5bee83..42e4a93 100755 --- a/bin/uninstall.sh +++ b/bin/uninstall.sh @@ -485,7 +485,9 @@ scan_applications() { local resolved_target="$link_target" if [[ "$link_target" != /* ]]; then local link_dir="${app_path%/*}" - resolved_target=$(cd "$link_dir" 2> /dev/null && cd "${link_target%/*}" 2> /dev/null && pwd)/"${link_target##*/}" 2> /dev/null || echo "" + local _link_parent="${link_target%/*}" + [[ "$_link_parent" == "$link_target" ]] && _link_parent="." + resolved_target=$(cd "$link_dir" 2> /dev/null && cd "$_link_parent" 2> /dev/null && pwd)/"${link_target##*/}" 2> /dev/null || echo "" fi case "$resolved_target" in /System/* | /usr/bin/* | /usr/lib/* | /bin/* | /sbin/* | /private/etc/*) diff --git a/lib/clean/user.sh b/lib/clean/user.sh index db21621..f5f0012 100644 --- a/lib/clean/user.sh +++ b/lib/clean/user.sh @@ -916,11 +916,14 @@ clean_external_volume_target() { size_kb=$(get_path_size_kb "$target_path" 2> /dev/null || echo "0") [[ "$size_kb" =~ ^[0-9]+$ ]] || size_kb=0 - found_any=true - cleaned_count=$((cleaned_count + 1)) - total_size=$((total_size + size_kb)) - if [[ "$DRY_RUN" != "true" ]]; then - safe_remove "$target_path" true > /dev/null 2>&1 || true + if [[ "$DRY_RUN" == "true" ]]; then + found_any=true + cleaned_count=$((cleaned_count + 1)) + total_size=$((total_size + size_kb)) + elif safe_remove "$target_path" true > /dev/null 2>&1; then + found_any=true + cleaned_count=$((cleaned_count + 1)) + total_size=$((total_size + size_kb)) fi done @@ -938,11 +941,14 @@ clean_external_volume_target() { size_kb=$(get_path_size_kb "$metadata_file" 2> /dev/null || echo "0") [[ "$size_kb" =~ ^[0-9]+$ ]] || size_kb=0 - found_any=true - cleaned_count=$((cleaned_count + 1)) - total_size=$((total_size + size_kb)) - if [[ "$DRY_RUN" != "true" ]]; then - safe_remove "$metadata_file" true > /dev/null 2>&1 || true + if [[ "$DRY_RUN" == "true" ]]; then + found_any=true + cleaned_count=$((cleaned_count + 1)) + total_size=$((total_size + size_kb)) + elif safe_remove "$metadata_file" true > /dev/null 2>&1; then + found_any=true + cleaned_count=$((cleaned_count + 1)) + total_size=$((total_size + size_kb)) fi done < <(command find "$volume" -type f -name "._*" -print0 2> /dev/null || true)