@@ -126,7 +126,7 @@ clean_sandboxed_app_caches() {
126126 # Check if dir exists and has content
127127 if [[ -d " $cache_dir " ]]; then
128128 # Fast check if empty (avoid expensive size calc on empty dirs)
129- if [[ -n " $( ls -A " $cache_dir " 2> /dev/null) " ]]; then
129+ if [[ -n " $( ls -A " $cache_dir " 2> /dev/null) " ]]; then
130130 # Get size
131131 local size=$( get_path_size_kb " $cache_dir " )
132132 (( total_size += size))
@@ -137,7 +137,7 @@ clean_sandboxed_app_caches() {
137137 # Clean contents safely
138138 # We know this is a user cache path, so rm -rf is acceptable here
139139 # provided we keep the Cache directory itself
140- rm -rf " $cache_dir " /* 2> /dev/null || true
140+ rm -rf " $cache_dir " /* 2> /dev/null || true
141141 fi
142142 fi
143143 fi
@@ -256,18 +256,18 @@ clean_application_support_logs() {
256256 local -a start_candidates=(" $app_dir /log" " $app_dir /logs" " $app_dir /activitylog" " $app_dir /Cache/Cache_Data" " $app_dir /Crashpad/completed" )
257257
258258 for candidate in " ${start_candidates[@]} " ; do
259- if [[ -d " $candidate " ]]; then
260- if [[ -n " $( ls -A " $candidate " 2> /dev/null) " ]]; then
259+ if [[ -d " $candidate " ]]; then
260+ if [[ -n " $( ls -A " $candidate " 2> /dev/null) " ]]; then
261261 local size=$( get_path_size_kb " $candidate " )
262262 (( total_size += size))
263263 (( cleaned_count++ ))
264264 found_any=true
265265
266266 if [[ " $DRY_RUN " != " true" ]]; then
267- safe_remove " $candidate " /* true > /dev/null 2>&1 || true
267+ safe_remove " $candidate " /* true > /dev/null 2>&1 || true
268268 fi
269269 fi
270- fi
270+ fi
271271 done
272272 done
273273
@@ -281,18 +281,18 @@ clean_application_support_logs() {
281281 local -a gc_candidates=(" $container_path /Logs" " $container_path /Library/Logs" )
282282
283283 for candidate in " ${gc_candidates[@]} " ; do
284- if [[ -d " $candidate " ]]; then
285- if [[ -n " $( ls -A " $candidate " 2> /dev/null) " ]]; then
284+ if [[ -d " $candidate " ]]; then
285+ if [[ -n " $( ls -A " $candidate " 2> /dev/null) " ]]; then
286286 local size=$( get_path_size_kb " $candidate " )
287287 (( total_size += size))
288288 (( cleaned_count++ ))
289289 found_any=true
290290
291291 if [[ " $DRY_RUN " != " true" ]]; then
292- safe_remove " $candidate " /* true > /dev/null 2>&1 || true
292+ safe_remove " $candidate " /* true > /dev/null 2>&1 || true
293293 fi
294294 fi
295- fi
295+ fi
296296 done
297297 done
298298
@@ -301,9 +301,9 @@ clean_application_support_logs() {
301301 if [[ " $found_any " == " true" ]]; then
302302 local size_human=$( bytes_to_human " $(( total_size * 1024 )) " )
303303 if [[ " $DRY_RUN " == " true" ]]; then
304- echo -e " ${YELLOW} →${NC} Application Support logs/caches ${YELLOW} ($size_human dry)${NC} "
304+ echo -e " ${YELLOW} →${NC} Application Support logs/caches ${YELLOW} ($size_human dry)${NC} "
305305 else
306- echo -e " ${GREEN}${ICON_SUCCESS}${NC} Application Support logs/caches ${GREEN} ($size_human )${NC} "
306+ echo -e " ${GREEN}${ICON_SUCCESS}${NC} Application Support logs/caches ${GREEN} ($size_human )${NC} "
307307 fi
308308 # Update global counters
309309 (( files_cleaned += cleaned_count))
0 commit comments