diff --git a/GUIDE.md b/GUIDE.md index 4497fdb..41e5bb0 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -19,7 +19,7 @@ 3. 找到"实用工具"文件夹 4. 双击"终端"图标 -> 💡 小提示:这个窗口看起来可能有点专业,但别担心,接下来的操作都很简单! +> 小提示:这个窗口看起来可能有点专业,但别担心,接下来的操作都很简单! --- @@ -51,11 +51,11 @@ brew install tw93/tap/mole ``` -> 💡 什么是 Homebrew?一个 Mac 软件管理工具。如果你不知道这是什么,请使用方法一。 +> 什么是 Homebrew?一个 Mac 软件管理工具。如果你不知道这是什么,请使用方法一。 > -> ⚠️ **重要:** 只选择一种方法安装!不要同时用两种方法,会产生冲突。 +> **重要:** 只选择一种方法安装!不要同时用两种方法,会产生冲突。 > -> ⚠️ 注意:第一次安装可能会要求你输入 Mac 的登录密码(输入时不会显示任何字符,这是正常的) +> 注意:第一次安装可能会要求你输入 Mac 的登录密码(输入时不会显示任何字符,这是正常的) --- @@ -80,7 +80,7 @@ brew install tw93/tap/mole ## 第四步:常见操作 -### ⚠️ 重要提示(请先阅读) +### 重要提示 **首次使用强烈建议:** @@ -204,4 +204,4 @@ mo analyze - [提交问题反馈](https://github.com/tw93/mole/issues) - [完整使用文档](./README.md) -**祝你使用愉快!如果觉得有用,欢迎分享给朋友 ✨** +**祝你使用愉快!如果觉得有用,欢迎分享给朋友~** diff --git a/README.md b/README.md index 550b6a8..ea2c92d 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@
🐹 Dig deep like a mole to clean your Mac.
+Dig deep like a mole to clean your Mac.
@@ -18,10 +18,10 @@ ## Features -- 🐦 **Deep System Cleanup** - Remove hidden caches, logs, and temp files in one sweep -- 📦 **Thorough Uninstall** - 22+ locations cleaned vs 1 standard, beats CleanMyMac/Lemon -- 📊 **Interactive Disk Analyzer** - Navigate folders like a file manager, find and delete large files instantly -- ⚡️ **Fast & Lightweight** - Terminal-based, zero bloat, arrow-key navigation with pagination +- **Deep System Cleanup** - Remove hidden caches, logs, and temp files in one sweep +- **Thorough Uninstall** - 22+ locations cleaned vs 1 standard, beats CleanMyMac/Lemon +- **Interactive Disk Analyzer** - Navigate folders like a file manager, find and delete large files instantly +- **Fast & Lightweight** - Terminal-based, zero bloat, arrow-key navigation with pagination ## Quick Start @@ -86,8 +86,8 @@ $ mo clean ✓ Spotify cache (3.1GB) ==================================================================== -🎉 CLEANUP COMPLETE! -💾 Space freed: 95.50GB | Free space now: 223.5GB +CLEANUP COMPLETE! +Space freed: 95.50GB | Free space now: 223.5GB ==================================================================== ``` @@ -96,13 +96,13 @@ $ mo clean ```bash $ mo uninstall -🗑️ Select Apps to Remove +Select Apps to Remove ═══════════════════════════ ▶ ☑ Adobe Creative Cloud (12.4G) | Old ☐ WeChat (2.1G) | Recent ☐ Final Cut Pro (3.8G) | Recent -🗑️ Uninstalling: Adobe Creative Cloud +Uninstalling: Adobe Creative Cloud ✓ Removed application # /Applications/ ✓ Cleaned 52 related files # ~/Library/ across 12 locations - Support files & caches # Application Support, Caches @@ -112,8 +112,8 @@ $ mo uninstall - System files with sudo # /Library/, Launch daemons ==================================================================== -🎉 UNINSTALLATION COMPLETE! -💾 Space freed: 12.8GB +UNINSTALLATION COMPLETE! +Space freed: 12.8GB ==================================================================== ``` @@ -122,7 +122,7 @@ $ mo uninstall ```bash $ mo analyze -📊 Analyzing: /Users/You +Analyzing: /Users/You ═══════════════════════════════════════════════════════ Total: 156.8GB @@ -132,7 +132,7 @@ Total: 156.8GB ├─ 📁 Downloads 32.6GB │ ├─ 📄 Xcode-14.3.1.dmg 12.3GB │ ├─ 📄 backup_2023.zip 8.6GB -│ └─ 📦 old_projects.tar.gz 5.2GB +│ └─ 📄 old_projects.tar.gz 5.2GB ├─ 📁 Movies 28.9GB │ ├─ 📄 vacation_2023.mov 15.4GB │ └─ 📄 screencast_raw.mp4 8.8GB diff --git a/bin/uninstall.sh b/bin/uninstall.sh index 9eb1d46..d3691f7 100755 --- a/bin/uninstall.sh +++ b/bin/uninstall.sh @@ -327,7 +327,7 @@ scan_applications() { # Update cache with app count metadata cp "${temp_file}.sorted" "$cache_file" 2>/dev/null || true echo "$current_app_count" > "$cache_meta" 2>/dev/null || true - + # Verify sorted file exists before returning if [[ -f "${temp_file}.sorted" ]]; then echo "${temp_file}.sorted" @@ -501,7 +501,7 @@ uninstall_applications() { log_success "Freed $freed_display of disk space" fi - echo "📊 Applications uninstalled: $files_cleaned" + echo "Applications uninstalled: $files_cleaned" ((total_size_cleaned += total_size_freed)) } diff --git a/lib/app_selector.sh b/lib/app_selector.sh index 6b515e3..7f12058 100755 --- a/lib/app_selector.sh +++ b/lib/app_selector.sh @@ -42,7 +42,7 @@ select_apps_for_uninstall() { # Use paginated menu - result will be stored in MOLE_SELECTION_RESULT MOLE_SELECTION_RESULT="" - paginated_multi_select "🗑️ Select Apps to Remove" "${menu_options[@]}" + paginated_multi_select "Select Apps to Remove" "${menu_options[@]}" local exit_code=$? if [[ $exit_code -ne 0 ]]; then @@ -76,4 +76,4 @@ select_apps_for_uninstall() { if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then echo "This is a library file. Source it from other scripts." >&2 exit 1 -fi \ No newline at end of file +fi diff --git a/lib/batch_uninstall.sh b/lib/batch_uninstall.sh index 58832f8..5e63898 100755 --- a/lib/batch_uninstall.sh +++ b/lib/batch_uninstall.sh @@ -63,13 +63,15 @@ batch_uninstall_applications() { if sudo -n true 2>/dev/null; then echo "◎ Admin access confirmed for: ${sudo_apps[*]}" else - echo -n "◎ Admin required for: ${sudo_apps[*]}. " - if ! sudo -v; then + echo "◎ Admin required for: ${sudo_apps[*]}" + echo "" + if ! request_sudo_access "Uninstalling system apps requires admin access"; then echo "" log_error "Admin access denied" return 1 fi - echo "✓ Granted" + echo "" + echo "✓ Admin access granted" fi echo "◎ Gathering targets..." (while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null) & @@ -145,7 +147,7 @@ batch_uninstall_applications() { printf " ${GREEN}OK${NC} %-20s%s\n" "$app_name" $([[ $files_removed -gt 0 ]] && echo "+$files_removed" ) else ((failed_count++)) - failed_items+=("$app_name:$reason") + failed_items+=("$app_name:$reason") fi done @@ -165,17 +167,17 @@ batch_uninstall_applications() { echo "" echo "$bar" if [[ $failed_count -gt 0 ]]; then - echo -e "🚀 Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}" + echo -e "Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}" if [[ $failed_count -eq 1 ]]; then local first="${failed_items[0]}" local name=${first%%:*} local reason=${first#*:} - echo "😉 ${name} $(map_uninstall_reason "$reason")" + echo "${name} $(map_uninstall_reason "$reason")" else - local joined="${failed_items[*]}"; echo "😉 Failures: $joined" + local joined="${failed_items[*]}"; echo "Failures: $joined" fi else - echo -e "🚀 Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}" + echo -e "Removed: ${GREEN}$success_count${NC} | Failed: ${RED}$failed_count${NC} | Freed: ${GREEN}$freed_display${NC}" fi echo "$bar" diff --git a/lib/paginated_menu.sh b/lib/paginated_menu.sh index 9514089..9a8fda4 100755 --- a/lib/paginated_menu.sh +++ b/lib/paginated_menu.sh @@ -50,8 +50,8 @@ paginated_multi_select() { restore_terminal() { show_cursor - if [[ -n "$original_stty" ]]; then - stty "$original_stty" 2>/dev/null || stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true + if [[ -n "${original_stty-}" ]]; then + stty "${original_stty}" 2>/dev/null || stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true else stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true fi diff --git a/lib/whitelist_manager.sh b/lib/whitelist_manager.sh index ad84104..d020b71 100755 --- a/lib/whitelist_manager.sh +++ b/lib/whitelist_manager.sh @@ -255,7 +255,7 @@ get_description_for_pattern() { manage_whitelist() { clear echo "" - echo -e "${PURPLE}📋 Whitelist Manager${NC}" + echo -e "${PURPLE}Whitelist Manager${NC}" echo "" # Load user-defined whitelist diff --git a/mole b/mole index d9370c5..5142d12 100755 --- a/mole +++ b/mole @@ -2,9 +2,9 @@ # Mole - Main Entry Point # A comprehensive macOS maintenance tool # -# 🧹 Clean - Remove junk files and optimize system -# 🗑️ Uninstall - Remove applications completely -# 📊 Analyze - Interactive disk space explorer +# Clean - Remove junk files and optimize system +# Uninstall - Remove applications completely +# Analyze - Interactive disk space explorer # # Usage: # ./mole # Interactive main menu @@ -44,7 +44,7 @@ check_for_updates() { grep '^VERSION=' | head -1 | sed 's/VERSION="\(.*\)"/\1/') if [[ -n "$latest" && "$VERSION" != "$latest" && "$(printf '%s\n' "$VERSION" "$latest" | sort -V | head -1)" == "$VERSION" ]]; then - echo -e "${YELLOW}📢 New version ${GREEN}${latest}${YELLOW} available (current: ${VERSION})\n Run ${GREEN}mole update${YELLOW} to upgrade${NC}" > "$msg_cache" + echo -e "${YELLOW}New version ${GREEN}${latest}${YELLOW} available (current: ${VERSION})\n Run ${GREEN}mole update${YELLOW} to upgrade${NC}" > "$msg_cache" else echo -n > "$msg_cache" fi @@ -213,7 +213,7 @@ update_mole() { remove_mole() { clear echo "" - echo -e "${YELLOW}⚠️ Remove Mole${NC}" + echo -e "${YELLOW}Remove Mole${NC}" echo "" # Detect all installations @@ -292,7 +292,6 @@ remove_mole() { fi echo "" - log_info "Removing Mole..." # Remove Homebrew installation if [[ "$is_homebrew" == "true" ]]; then @@ -341,7 +340,7 @@ remove_mole() { fi echo "" - echo -e "${GREEN}✨ Mole has been removed successfully${NC}" + echo -e "${GREEN}Mole has been removed successfully${NC}" echo "" echo "Thank you for using Mole!"