Skip to content

Commit 012c0b2

Browse files
committed
chore: auto format code
1 parent da73cb9 commit 012c0b2

File tree

3 files changed

+23
-23
lines changed

3 files changed

+23
-23
lines changed

lib/clean/dev.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ clean_dev_mobile() {
153153
debug_log "Checking for unavailable Xcode simulators"
154154

155155
if [[ "$DRY_RUN" == "true" ]]; then
156-
clean_tool_cache "Xcode unavailable simulators" xcrun simctl delete unavailable
156+
clean_tool_cache "Xcode unavailable simulators" xcrun simctl delete unavailable
157157
else
158158
if [[ -t 1 ]]; then
159159
MOLE_SPINNER_PREFIX=" " start_inline_spinner "Checking unavailable simulators..."
@@ -315,10 +315,10 @@ clean_developer_tools() {
315315
safe_clean "$lock_dir"/* "Homebrew lock files"
316316
elif [[ -d "$lock_dir" ]]; then
317317
# Directory exists but not writable. Check if empty to avoid noise.
318-
if [[ -n "$(ls -A "$lock_dir" 2>/dev/null)" ]]; then
319-
# Only try sudo ONCE if we really need to, or just skip to avoid spam
320-
# Decision: Skip strict system/root owned locks to avoid nag.
321-
debug_log "Skipping read-only Homebrew locks in $lock_dir"
318+
if [[ -n "$(ls -A "$lock_dir" 2> /dev/null)" ]]; then
319+
# Only try sudo ONCE if we really need to, or just skip to avoid spam
320+
# Decision: Skip strict system/root owned locks to avoid nag.
321+
debug_log "Skipping read-only Homebrew locks in $lock_dir"
322322
fi
323323
fi
324324
done

lib/clean/system.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ clean_time_machine_failed_backups() {
133133
[[ "$volume" == "/Volumes/MacintoshHD" || "$volume" == "/" ]] && continue
134134

135135
if [[ -t 1 ]]; then
136-
MOLE_SPINNER_PREFIX=" " start_inline_spinner "Scanning backup volumes..."
136+
MOLE_SPINNER_PREFIX=" " start_inline_spinner "Scanning backup volumes..."
137137
fi
138138

139139
# Skip if volume is a symlink (security check)
@@ -290,7 +290,7 @@ clean_local_snapshots() {
290290
# Format: com.apple.TimeMachine.2023-10-25-120000
291291
if [[ "$line" =~ com\.apple\.TimeMachine\.([0-9]{4})-([0-9]{2})-([0-9]{2})-([0-9]{6}) ]]; then
292292
local date_str="${BASH_REMATCH[1]}-${BASH_REMATCH[2]}-${BASH_REMATCH[3]} ${BASH_REMATCH[4]:0:2}:${BASH_REMATCH[4]:2:2}:${BASH_REMATCH[4]:4:2}"
293-
local snap_ts=$(date -j -f "%Y-%m-%d %H:%M:%S" "$date_str" "+%s" 2>/dev/null || echo "0")
293+
local snap_ts=$(date -j -f "%Y-%m-%d %H:%M:%S" "$date_str" "+%s" 2> /dev/null || echo "0")
294294

295295
# Skip if parsing failed
296296
[[ "$snap_ts" == "0" ]] && continue
@@ -306,11 +306,11 @@ clean_local_snapshots() {
306306
else
307307
# Secure removal
308308
if safe_sudo tmutil deletelocalsnapshots "${BASH_REMATCH[1]}-${BASH_REMATCH[2]}-${BASH_REMATCH[3]}-${BASH_REMATCH[4]}" > /dev/null 2>&1; then
309-
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Removed snapshot: $snap_name"
310-
((cleaned_count++))
311-
note_activity
309+
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Removed snapshot: $snap_name"
310+
((cleaned_count++))
311+
note_activity
312312
else
313-
echo -e " ${YELLOW}!${NC} Failed to remove: $snap_name"
313+
echo -e " ${YELLOW}!${NC} Failed to remove: $snap_name"
314314
fi
315315
fi
316316
fi

lib/clean/user.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)