mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 21:55:08 +00:00
chore(dev-clean): streamline runtime volume reporting
- reduce noisy scan output outside debug mode - consolidate final result messaging - run xcode/code editor stages explicitly in developer flow - update dev cache tests for new stage calls
This commit is contained in:
@@ -366,7 +366,10 @@ clean_xcode_simulator_runtime_volumes() {
|
|||||||
[[ -n "$sorted" ]] && sorted_candidates+=("$sorted")
|
[[ -n "$sorted" ]] && sorted_candidates+=("$sorted")
|
||||||
done < <(printf '%s\n' "${candidates[@]}" | LC_ALL=C sort)
|
done < <(printf '%s\n' "${candidates[@]}" | LC_ALL=C sort)
|
||||||
|
|
||||||
echo -e " ${GRAY}${ICON_LIST}${NC} Xcode runtime volumes · scanning ${#sorted_candidates[@]} entries"
|
# Only show scanning message in debug mode; spinner provides visual feedback otherwise
|
||||||
|
if [[ "${MO_DEBUG:-0}" == "1" ]]; then
|
||||||
|
echo -e " ${GRAY}${ICON_LIST}${NC} Xcode runtime volumes · scanning ${#sorted_candidates[@]} entries"
|
||||||
|
fi
|
||||||
local runtime_scan_spinner=false
|
local runtime_scan_spinner=false
|
||||||
if [[ -t 1 ]]; then
|
if [[ -t 1 ]]; then
|
||||||
start_section_spinner "Scanning Xcode runtime volumes..."
|
start_section_spinner "Scanning Xcode runtime volumes..."
|
||||||
@@ -474,24 +477,20 @@ clean_xcode_simulator_runtime_volumes() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ${#selected_paths[@]} -eq 0 ]]; then
|
if [[ ${#selected_paths[@]} -eq 0 ]]; then
|
||||||
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Xcode runtime volumes · nothing to clean"
|
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Xcode runtime volumes · already clean"
|
||||||
note_activity
|
note_activity
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! has_sudo_session; then
|
if ! has_sudo_session; then
|
||||||
if ! ensure_sudo_session "Cleaning Xcode runtime volumes requires admin access"; then
|
if ! ensure_sudo_session "Cleaning Xcode runtime volumes requires admin access"; then
|
||||||
echo -e " ${GRAY}${ICON_WARNING}${NC} Xcode runtime volumes cleanup skipped (sudo denied)"
|
echo -e " ${YELLOW}${ICON_WARNING}${NC} Xcode runtime volumes · skipped (sudo denied)"
|
||||||
note_activity
|
note_activity
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Xcode runtime volumes · cleaning ${#selected_paths[@]} unused"
|
# Perform cleanup and report final result in one line
|
||||||
if [[ $skipped_protected -gt 0 ]]; then
|
|
||||||
echo -e " ${GRAY}${ICON_WARNING}${NC} Xcode runtime volumes · skipped ${skipped_protected} protected items"
|
|
||||||
fi
|
|
||||||
|
|
||||||
local removed_count=0
|
local removed_count=0
|
||||||
local removed_size_kb=0
|
local removed_size_kb=0
|
||||||
local selected_path
|
local selected_path
|
||||||
@@ -504,13 +503,22 @@ clean_xcode_simulator_runtime_volumes() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Unified output: report result, not intermediate steps
|
||||||
if [[ $removed_count -gt 0 ]]; then
|
if [[ $removed_count -gt 0 ]]; then
|
||||||
local removed_human
|
local removed_human
|
||||||
removed_human=$(bytes_to_human "$((removed_size_kb * 1024))")
|
removed_human=$(bytes_to_human "$((removed_size_kb * 1024))")
|
||||||
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Xcode runtime volumes · removed ${removed_count}, ${removed_human}"
|
if [[ $skipped_protected -gt 0 ]]; then
|
||||||
|
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Xcode runtime volumes · removed ${removed_count} (${removed_human}), skipped ${skipped_protected} protected"
|
||||||
|
else
|
||||||
|
echo -e " ${GREEN}${ICON_SUCCESS}${NC} Xcode runtime volumes · removed ${removed_count} (${removed_human})"
|
||||||
|
fi
|
||||||
note_activity
|
note_activity
|
||||||
else
|
else
|
||||||
echo -e " ${GRAY}${ICON_WARNING}${NC} Xcode runtime volumes · no items removed"
|
if [[ $skipped_protected -gt 0 ]]; then
|
||||||
|
echo -e " ${YELLOW}${ICON_WARNING}${NC} Xcode runtime volumes · skipped ${skipped_protected} protected, none removed"
|
||||||
|
else
|
||||||
|
echo -e " ${GRAY}${ICON_EMPTY}${NC} Xcode runtime volumes · nothing removed"
|
||||||
|
fi
|
||||||
note_activity
|
note_activity
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -838,6 +846,8 @@ clean_dev_editors() {
|
|||||||
# Main developer tools cleanup sequence.
|
# Main developer tools cleanup sequence.
|
||||||
clean_developer_tools() {
|
clean_developer_tools() {
|
||||||
stop_section_spinner
|
stop_section_spinner
|
||||||
|
|
||||||
|
# CLI tools and languages
|
||||||
clean_sqlite_temp_files
|
clean_sqlite_temp_files
|
||||||
clean_dev_npm
|
clean_dev_npm
|
||||||
clean_dev_python
|
clean_dev_python
|
||||||
@@ -862,9 +872,13 @@ clean_developer_tools() {
|
|||||||
clean_dev_elixir
|
clean_dev_elixir
|
||||||
clean_dev_haskell
|
clean_dev_haskell
|
||||||
clean_dev_ocaml
|
clean_dev_ocaml
|
||||||
clean_dev_editors
|
|
||||||
|
# GUI developer applications
|
||||||
|
clean_xcode_tools
|
||||||
|
clean_code_editors
|
||||||
|
|
||||||
|
# Homebrew
|
||||||
safe_clean ~/Library/Caches/Homebrew/* "Homebrew cache"
|
safe_clean ~/Library/Caches/Homebrew/* "Homebrew cache"
|
||||||
# Clean Homebrew locks without repeated sudo prompts.
|
|
||||||
local brew_lock_dirs=(
|
local brew_lock_dirs=(
|
||||||
"/opt/homebrew/var/homebrew/locks"
|
"/opt/homebrew/var/homebrew/locks"
|
||||||
"/usr/local/var/homebrew/locks"
|
"/usr/local/var/homebrew/locks"
|
||||||
|
|||||||
@@ -212,6 +212,9 @@ clean_dev_elixir() { :; }
|
|||||||
clean_dev_haskell() { :; }
|
clean_dev_haskell() { :; }
|
||||||
clean_dev_ocaml() { :; }
|
clean_dev_ocaml() { :; }
|
||||||
clean_dev_editors() { :; }
|
clean_dev_editors() { :; }
|
||||||
|
clean_code_editors() { :; }
|
||||||
|
clean_dev_jetbrains_toolbox() { :; }
|
||||||
|
clean_xcode_tools() { :; }
|
||||||
safe_clean() { :; }
|
safe_clean() { :; }
|
||||||
debug_log() { :; }
|
debug_log() { :; }
|
||||||
clean_developer_tools
|
clean_developer_tools
|
||||||
|
|||||||
Reference in New Issue
Block a user