From 194e8ad29ab44d89af60ab3474b3f2457156dad0 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sat, 28 Feb 2026 03:11:16 +0000 Subject: [PATCH] chore: auto format code --- lib/core/base.sh | 4 ++-- lib/core/file_ops.sh | 2 +- test_rounding.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/core/base.sh b/lib/core/base.sh index 16e9860..54d108e 100644 --- a/lib/core/base.sh +++ b/lib/core/base.sh @@ -461,11 +461,11 @@ bytes_to_human() { # GB: >= 1,000,000,000 bytes if ((bytes >= 1000000000)); then - local scaled=$(( (bytes * 100 + 500000000) / 1000000000 )) + local scaled=$(((bytes * 100 + 500000000) / 1000000000)) printf "%d.%02dGB\n" $((scaled / 100)) $((scaled % 100)) # MB: >= 1,000,000 bytes elif ((bytes >= 1000000)); then - local scaled=$(( (bytes * 10 + 500000) / 1000000 )) + local scaled=$(((bytes * 10 + 500000) / 1000000)) printf "%d.%01dMB\n" $((scaled / 10)) $((scaled % 10)) # KB: >= 1,000 bytes (round up to nearest KB instead of decimal) elif ((bytes >= 1000)); then diff --git a/lib/core/file_ops.sh b/lib/core/file_ops.sh index 9821fd5..5c41618 100644 --- a/lib/core/file_ops.sh +++ b/lib/core/file_ops.sh @@ -503,7 +503,7 @@ get_path_size_kb() { echo "0" return } - + # For .app bundles, prefer mdls logical size as it matches Finder # (APFS clone/sparse files make 'du' severely underreport apps like Xcode) if [[ "$path" == *.app || "$path" == *.app/ ]]; then diff --git a/test_rounding.sh b/test_rounding.sh index a52d6ec..c7cb772 100755 --- a/test_rounding.sh +++ b/test_rounding.sh @@ -1,10 +1,10 @@ bytes_to_human_new() { local bytes="$1" if ((bytes >= 1000000000)); then - local scaled=$(( (bytes * 100 + 500000000) / 1000000000 )) + local scaled=$(((bytes * 100 + 500000000) / 1000000000)) printf "%d.%02dGB\n" $((scaled / 100)) $((scaled % 100)) elif ((bytes >= 1000000)); then - local scaled=$(( (bytes * 10 + 500000) / 1000000 )) + local scaled=$(((bytes * 10 + 500000) / 1000000)) printf "%d.%01dMB\n" $((scaled / 10)) $((scaled % 10)) elif ((bytes >= 1000)); then printf "%dKB\n" $(((bytes + 500) / 1000))