mirror of
https://github.com/tw93/Mole.git
synced 2026-02-14 20:32:28 +00:00
Empty line normalization
This commit is contained in:
@@ -486,14 +486,13 @@ start_cleanup() {
|
|||||||
clear
|
clear
|
||||||
printf '\n'
|
printf '\n'
|
||||||
echo -e "${PURPLE}Clean Your Mac${NC}"
|
echo -e "${PURPLE}Clean Your Mac${NC}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
if [[ "$DRY_RUN" != "true" && -t 0 ]]; then
|
if [[ "$DRY_RUN" != "true" && -t 0 ]]; then
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}☻${NC} First time? Run ${GRAY}mo clean --dry-run${NC} first to preview changes"
|
echo -e "${YELLOW}☻${NC} First time? Run ${GRAY}mo clean --dry-run${NC} first to preview changes"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$DRY_RUN" == "true" ]]; then
|
if [[ "$DRY_RUN" == "true" ]]; then
|
||||||
echo ""
|
|
||||||
echo -e "${YELLOW}Dry Run Mode${NC} - Preview only, no deletions"
|
echo -e "${YELLOW}Dry Run Mode${NC} - Preview only, no deletions"
|
||||||
echo ""
|
echo ""
|
||||||
SYSTEM_CLEAN=false
|
SYSTEM_CLEAN=false
|
||||||
@@ -501,7 +500,6 @@ start_cleanup() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -t 0 ]]; then
|
if [[ -t 0 ]]; then
|
||||||
echo ""
|
|
||||||
echo -ne "${PURPLE}${ICON_ARROW}${NC} System caches need sudo — ${GREEN}Enter${NC} continue, ${GRAY}Space${NC} skip: "
|
echo -ne "${PURPLE}${ICON_ARROW}${NC} System caches need sudo — ${GREEN}Enter${NC} continue, ${GRAY}Space${NC} skip: "
|
||||||
|
|
||||||
# Use read_key to properly handle all key inputs
|
# Use read_key to properly handle all key inputs
|
||||||
|
|||||||
@@ -10,8 +10,9 @@ source "$SCRIPT_DIR/lib/optimize_health.sh"
|
|||||||
# Colors and icons from common.sh
|
# Colors and icons from common.sh
|
||||||
|
|
||||||
print_header() {
|
print_header() {
|
||||||
echo ""
|
printf '\n'
|
||||||
echo -e "${PURPLE}Optimize Your Mac${NC}"
|
echo -e "${PURPLE}Optimize Your Mac${NC}"
|
||||||
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
show_system_health() {
|
show_system_health() {
|
||||||
|
|||||||
@@ -690,19 +690,24 @@ main() {
|
|||||||
unset MOLE_ALT_SCREEN_ACTIVE
|
unset MOLE_ALT_SCREEN_ACTIVE
|
||||||
unset MOLE_INLINE_LOADING MOLE_MANAGED_ALT_SCREEN
|
unset MOLE_INLINE_LOADING MOLE_MANAGED_ALT_SCREEN
|
||||||
fi
|
fi
|
||||||
|
show_cursor
|
||||||
|
clear_screen
|
||||||
|
printf '\033[2J\033[H' >&2 # Also clear stderr
|
||||||
rm -f "$apps_file"
|
rm -f "$apps_file"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Always clear on exit from selection, regardless of alt screen state
|
||||||
if [[ "${MOLE_ALT_SCREEN_ACTIVE:-}" == "1" ]]; then
|
if [[ "${MOLE_ALT_SCREEN_ACTIVE:-}" == "1" ]]; then
|
||||||
leave_alt_screen
|
leave_alt_screen
|
||||||
unset MOLE_ALT_SCREEN_ACTIVE
|
unset MOLE_ALT_SCREEN_ACTIVE
|
||||||
unset MOLE_INLINE_LOADING MOLE_MANAGED_ALT_SCREEN
|
unset MOLE_INLINE_LOADING MOLE_MANAGED_ALT_SCREEN
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Restore cursor and show a concise summary before confirmation
|
# Restore cursor and clear screen (output to both stdout and stderr for reliability)
|
||||||
show_cursor
|
show_cursor
|
||||||
clear
|
clear_screen
|
||||||
|
printf '\033[2J\033[H' >&2 # Also clear stderr in case of mixed output
|
||||||
local selection_count=${#selected_apps[@]}
|
local selection_count=${#selected_apps[@]}
|
||||||
if [[ $selection_count -eq 0 ]]; then
|
if [[ $selection_count -eq 0 ]]; then
|
||||||
echo "No apps selected"
|
echo "No apps selected"
|
||||||
@@ -717,7 +722,7 @@ main() {
|
|||||||
local name_trunc_limit=30
|
local name_trunc_limit=30
|
||||||
|
|
||||||
for selected_app in "${selected_apps[@]}"; do
|
for selected_app in "${selected_apps[@]}"; do
|
||||||
IFS='|' read -r epoch app_path app_name bundle_id size last_used <<< "$selected_app"
|
IFS='|' read -r epoch app_path app_name bundle_id size last_used size_kb <<< "$selected_app"
|
||||||
|
|
||||||
local display_name="$app_name"
|
local display_name="$app_name"
|
||||||
if [[ ${#display_name} -gt $name_trunc_limit ]]; then
|
if [[ ${#display_name} -gt $name_trunc_limit ]]; then
|
||||||
@@ -743,10 +748,9 @@ main() {
|
|||||||
local index=1
|
local index=1
|
||||||
for row in "${summary_rows[@]}"; do
|
for row in "${summary_rows[@]}"; do
|
||||||
IFS='|' read -r name_cell size_cell last_cell <<< "$row"
|
IFS='|' read -r name_cell size_cell last_cell <<< "$row"
|
||||||
printf " %2d. %-*s %*s | Last: %s\n" "$index" "$max_name_width" "$name_cell" "$max_size_width" "$size_cell" "$last_cell"
|
printf "%d. %-*s %*s | Last: %s\n" "$index" "$max_name_width" "$name_cell" "$max_size_width" "$size_cell" "$last_cell"
|
||||||
((index++))
|
((index++))
|
||||||
done
|
done
|
||||||
echo ""
|
|
||||||
|
|
||||||
# Execute batch uninstallation (handles confirmation)
|
# Execute batch uninstallation (handles confirmation)
|
||||||
batch_uninstall_applications
|
batch_uninstall_applications
|
||||||
|
|||||||
2
mole
2
mole
@@ -22,7 +22,7 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
source "$SCRIPT_DIR/lib/common.sh"
|
source "$SCRIPT_DIR/lib/common.sh"
|
||||||
|
|
||||||
# Version info
|
# Version info
|
||||||
VERSION="1.9.19"
|
VERSION="1.9.20"
|
||||||
MOLE_TAGLINE="can dig deep to clean your Mac."
|
MOLE_TAGLINE="can dig deep to clean your Mac."
|
||||||
|
|
||||||
# Get latest version from remote repository
|
# Get latest version from remote repository
|
||||||
|
|||||||
Reference in New Issue
Block a user