mirror of
https://github.com/tw93/Mole.git
synced 2026-02-12 05:18:59 +00:00
I don't like emojis anymore
This commit is contained in:
12
GUIDE.md
12
GUIDE.md
@@ -19,7 +19,7 @@
|
|||||||
3. 找到"实用工具"文件夹
|
3. 找到"实用工具"文件夹
|
||||||
4. 双击"终端"图标
|
4. 双击"终端"图标
|
||||||
|
|
||||||
> 💡 小提示:这个窗口看起来可能有点专业,但别担心,接下来的操作都很简单!
|
> 小提示:这个窗口看起来可能有点专业,但别担心,接下来的操作都很简单!
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -51,11 +51,11 @@
|
|||||||
brew install tw93/tap/mole
|
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)
|
- [提交问题反馈](https://github.com/tw93/mole/issues)
|
||||||
- [完整使用文档](./README.md)
|
- [完整使用文档](./README.md)
|
||||||
|
|
||||||
**祝你使用愉快!如果觉得有用,欢迎分享给朋友 ✨**
|
**祝你使用愉快!如果觉得有用,欢迎分享给朋友~**
|
||||||
|
|||||||
26
README.md
26
README.md
@@ -1,6 +1,6 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<h1>Mole</h1>
|
<h1>Mole</h1>
|
||||||
<p><em>🐹 Dig deep like a mole to clean your Mac.</em></p>
|
<p><em>Dig deep like a mole to clean your Mac.</em></p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
@@ -18,10 +18,10 @@
|
|||||||
|
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- 🐦 **Deep System Cleanup** - Remove hidden caches, logs, and temp files in one sweep
|
- **Deep System Cleanup** - Remove hidden caches, logs, and temp files in one sweep
|
||||||
- 📦 **Thorough Uninstall** - 22+ locations cleaned vs 1 standard, beats CleanMyMac/Lemon
|
- **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
|
- **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
|
- **Fast & Lightweight** - Terminal-based, zero bloat, arrow-key navigation with pagination
|
||||||
|
|
||||||
## Quick Start
|
## Quick Start
|
||||||
|
|
||||||
@@ -86,8 +86,8 @@ $ mo clean
|
|||||||
✓ Spotify cache (3.1GB)
|
✓ Spotify cache (3.1GB)
|
||||||
|
|
||||||
====================================================================
|
====================================================================
|
||||||
🎉 CLEANUP COMPLETE!
|
CLEANUP COMPLETE!
|
||||||
💾 Space freed: 95.50GB | Free space now: 223.5GB
|
Space freed: 95.50GB | Free space now: 223.5GB
|
||||||
====================================================================
|
====================================================================
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -96,13 +96,13 @@ $ mo clean
|
|||||||
```bash
|
```bash
|
||||||
$ mo uninstall
|
$ mo uninstall
|
||||||
|
|
||||||
🗑️ Select Apps to Remove
|
Select Apps to Remove
|
||||||
═══════════════════════════
|
═══════════════════════════
|
||||||
▶ ☑ Adobe Creative Cloud (12.4G) | Old
|
▶ ☑ Adobe Creative Cloud (12.4G) | Old
|
||||||
☐ WeChat (2.1G) | Recent
|
☐ WeChat (2.1G) | Recent
|
||||||
☐ Final Cut Pro (3.8G) | Recent
|
☐ Final Cut Pro (3.8G) | Recent
|
||||||
|
|
||||||
🗑️ Uninstalling: Adobe Creative Cloud
|
Uninstalling: Adobe Creative Cloud
|
||||||
✓ Removed application # /Applications/
|
✓ Removed application # /Applications/
|
||||||
✓ Cleaned 52 related files # ~/Library/ across 12 locations
|
✓ Cleaned 52 related files # ~/Library/ across 12 locations
|
||||||
- Support files & caches # Application Support, Caches
|
- Support files & caches # Application Support, Caches
|
||||||
@@ -112,8 +112,8 @@ $ mo uninstall
|
|||||||
- System files with sudo # /Library/, Launch daemons
|
- System files with sudo # /Library/, Launch daemons
|
||||||
|
|
||||||
====================================================================
|
====================================================================
|
||||||
🎉 UNINSTALLATION COMPLETE!
|
UNINSTALLATION COMPLETE!
|
||||||
💾 Space freed: 12.8GB
|
Space freed: 12.8GB
|
||||||
====================================================================
|
====================================================================
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -122,7 +122,7 @@ $ mo uninstall
|
|||||||
```bash
|
```bash
|
||||||
$ mo analyze
|
$ mo analyze
|
||||||
|
|
||||||
📊 Analyzing: /Users/You
|
Analyzing: /Users/You
|
||||||
═══════════════════════════════════════════════════════
|
═══════════════════════════════════════════════════════
|
||||||
Total: 156.8GB
|
Total: 156.8GB
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ Total: 156.8GB
|
|||||||
├─ 📁 Downloads 32.6GB
|
├─ 📁 Downloads 32.6GB
|
||||||
│ ├─ 📄 Xcode-14.3.1.dmg 12.3GB
|
│ ├─ 📄 Xcode-14.3.1.dmg 12.3GB
|
||||||
│ ├─ 📄 backup_2023.zip 8.6GB
|
│ ├─ 📄 backup_2023.zip 8.6GB
|
||||||
│ └─ 📦 old_projects.tar.gz 5.2GB
|
│ └─ 📄 old_projects.tar.gz 5.2GB
|
||||||
├─ 📁 Movies 28.9GB
|
├─ 📁 Movies 28.9GB
|
||||||
│ ├─ 📄 vacation_2023.mov 15.4GB
|
│ ├─ 📄 vacation_2023.mov 15.4GB
|
||||||
│ └─ 📄 screencast_raw.mp4 8.8GB
|
│ └─ 📄 screencast_raw.mp4 8.8GB
|
||||||
|
|||||||
@@ -327,7 +327,7 @@ scan_applications() {
|
|||||||
# Update cache with app count metadata
|
# Update cache with app count metadata
|
||||||
cp "${temp_file}.sorted" "$cache_file" 2>/dev/null || true
|
cp "${temp_file}.sorted" "$cache_file" 2>/dev/null || true
|
||||||
echo "$current_app_count" > "$cache_meta" 2>/dev/null || true
|
echo "$current_app_count" > "$cache_meta" 2>/dev/null || true
|
||||||
|
|
||||||
# Verify sorted file exists before returning
|
# Verify sorted file exists before returning
|
||||||
if [[ -f "${temp_file}.sorted" ]]; then
|
if [[ -f "${temp_file}.sorted" ]]; then
|
||||||
echo "${temp_file}.sorted"
|
echo "${temp_file}.sorted"
|
||||||
@@ -501,7 +501,7 @@ uninstall_applications() {
|
|||||||
log_success "Freed $freed_display of disk space"
|
log_success "Freed $freed_display of disk space"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "📊 Applications uninstalled: $files_cleaned"
|
echo "Applications uninstalled: $files_cleaned"
|
||||||
((total_size_cleaned += total_size_freed))
|
((total_size_cleaned += total_size_freed))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ select_apps_for_uninstall() {
|
|||||||
|
|
||||||
# Use paginated menu - result will be stored in MOLE_SELECTION_RESULT
|
# Use paginated menu - result will be stored in MOLE_SELECTION_RESULT
|
||||||
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=$?
|
local exit_code=$?
|
||||||
|
|
||||||
if [[ $exit_code -ne 0 ]]; then
|
if [[ $exit_code -ne 0 ]]; then
|
||||||
@@ -76,4 +76,4 @@ select_apps_for_uninstall() {
|
|||||||
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
|
||||||
echo "This is a library file. Source it from other scripts." >&2
|
echo "This is a library file. Source it from other scripts." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -63,13 +63,15 @@ batch_uninstall_applications() {
|
|||||||
if sudo -n true 2>/dev/null; then
|
if sudo -n true 2>/dev/null; then
|
||||||
echo "◎ Admin access confirmed for: ${sudo_apps[*]}"
|
echo "◎ Admin access confirmed for: ${sudo_apps[*]}"
|
||||||
else
|
else
|
||||||
echo -n "◎ Admin required for: ${sudo_apps[*]}. "
|
echo "◎ Admin required for: ${sudo_apps[*]}"
|
||||||
if ! sudo -v; then
|
echo ""
|
||||||
|
if ! request_sudo_access "Uninstalling system apps requires admin access"; then
|
||||||
echo ""
|
echo ""
|
||||||
log_error "Admin access denied"
|
log_error "Admin access denied"
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
echo "✓ Granted"
|
echo ""
|
||||||
|
echo "✓ Admin access granted"
|
||||||
fi
|
fi
|
||||||
echo "◎ Gathering targets..."
|
echo "◎ Gathering targets..."
|
||||||
(while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null) &
|
(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" )
|
printf " ${GREEN}OK${NC} %-20s%s\n" "$app_name" $([[ $files_removed -gt 0 ]] && echo "+$files_removed" )
|
||||||
else
|
else
|
||||||
((failed_count++))
|
((failed_count++))
|
||||||
failed_items+=("$app_name:$reason")
|
failed_items+=("$app_name:$reason")
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
@@ -165,17 +167,17 @@ batch_uninstall_applications() {
|
|||||||
echo ""
|
echo ""
|
||||||
echo "$bar"
|
echo "$bar"
|
||||||
if [[ $failed_count -gt 0 ]]; then
|
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
|
if [[ $failed_count -eq 1 ]]; then
|
||||||
local first="${failed_items[0]}"
|
local first="${failed_items[0]}"
|
||||||
local name=${first%%:*}
|
local name=${first%%:*}
|
||||||
local reason=${first#*:}
|
local reason=${first#*:}
|
||||||
echo "😉 ${name} $(map_uninstall_reason "$reason")"
|
echo "${name} $(map_uninstall_reason "$reason")"
|
||||||
else
|
else
|
||||||
local joined="${failed_items[*]}"; echo "😉 Failures: $joined"
|
local joined="${failed_items[*]}"; echo "Failures: $joined"
|
||||||
fi
|
fi
|
||||||
else
|
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
|
fi
|
||||||
echo "$bar"
|
echo "$bar"
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,8 @@ paginated_multi_select() {
|
|||||||
|
|
||||||
restore_terminal() {
|
restore_terminal() {
|
||||||
show_cursor
|
show_cursor
|
||||||
if [[ -n "$original_stty" ]]; then
|
if [[ -n "${original_stty-}" ]]; then
|
||||||
stty "$original_stty" 2>/dev/null || stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true
|
stty "${original_stty}" 2>/dev/null || stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true
|
||||||
else
|
else
|
||||||
stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true
|
stty sane 2>/dev/null || stty echo icanon 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ get_description_for_pattern() {
|
|||||||
manage_whitelist() {
|
manage_whitelist() {
|
||||||
clear
|
clear
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${PURPLE}📋 Whitelist Manager${NC}"
|
echo -e "${PURPLE}Whitelist Manager${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Load user-defined whitelist
|
# Load user-defined whitelist
|
||||||
|
|||||||
13
mole
13
mole
@@ -2,9 +2,9 @@
|
|||||||
# Mole - Main Entry Point
|
# Mole - Main Entry Point
|
||||||
# A comprehensive macOS maintenance tool
|
# A comprehensive macOS maintenance tool
|
||||||
#
|
#
|
||||||
# 🧹 Clean - Remove junk files and optimize system
|
# Clean - Remove junk files and optimize system
|
||||||
# 🗑️ Uninstall - Remove applications completely
|
# Uninstall - Remove applications completely
|
||||||
# 📊 Analyze - Interactive disk space explorer
|
# Analyze - Interactive disk space explorer
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
# ./mole # Interactive main menu
|
# ./mole # Interactive main menu
|
||||||
@@ -44,7 +44,7 @@ check_for_updates() {
|
|||||||
grep '^VERSION=' | head -1 | sed 's/VERSION="\(.*\)"/\1/')
|
grep '^VERSION=' | head -1 | sed 's/VERSION="\(.*\)"/\1/')
|
||||||
|
|
||||||
if [[ -n "$latest" && "$VERSION" != "$latest" && "$(printf '%s\n' "$VERSION" "$latest" | sort -V | head -1)" == "$VERSION" ]]; then
|
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
|
else
|
||||||
echo -n > "$msg_cache"
|
echo -n > "$msg_cache"
|
||||||
fi
|
fi
|
||||||
@@ -213,7 +213,7 @@ update_mole() {
|
|||||||
remove_mole() {
|
remove_mole() {
|
||||||
clear
|
clear
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${YELLOW}⚠️ Remove Mole${NC}"
|
echo -e "${YELLOW}Remove Mole${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
|
|
||||||
# Detect all installations
|
# Detect all installations
|
||||||
@@ -292,7 +292,6 @@ remove_mole() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
log_info "Removing Mole..."
|
|
||||||
|
|
||||||
# Remove Homebrew installation
|
# Remove Homebrew installation
|
||||||
if [[ "$is_homebrew" == "true" ]]; then
|
if [[ "$is_homebrew" == "true" ]]; then
|
||||||
@@ -341,7 +340,7 @@ remove_mole() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo -e "${GREEN}✨ Mole has been removed successfully${NC}"
|
echo -e "${GREEN}Mole has been removed successfully${NC}"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Thank you for using Mole!"
|
echo "Thank you for using Mole!"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user