1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-14 18:47:28 +00:00

🎨 update use

This commit is contained in:
Tw93
2025-09-25 22:10:30 +08:00
parent c6cc046a18
commit 00103ae75b
3 changed files with 24 additions and 14 deletions

View File

@@ -21,7 +21,7 @@ curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
```bash ```bash
mole # Interactive main menu mole # Interactive main menu
mole clean # Deep clean (smart sudo handling) mole clean # Deeper system cleanup
mole uninstall # Interactive app uninstaller mole uninstall # Interactive app uninstaller
mole --help # Show help mole --help # Show help
``` ```
@@ -29,7 +29,7 @@ mole --help # Show help
### Example Output ### Example Output
```bash ```bash
🕳️ Mole - System Cleanup 🕳️ Mole - Deeper system cleanup
======================== ========================
🍎 Detected: Apple Silicon | 💾 Free space: 45.2GB 🍎 Detected: Apple Silicon | 💾 Free space: 45.2GB
🚀 Mode: User-level cleanup (no password required) 🚀 Mode: User-level cleanup (no password required)

View File

@@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# Mole - System Cleanup Module # Mole - Deeper system cleanup
# Complete cleanup with smart password handling # Complete cleanup with smart password handling
set -euo pipefail set -euo pipefail
@@ -295,8 +295,8 @@ safe_clean() {
start_cleanup() { start_cleanup() {
clear clear
echo "🕳️ Mole - System Cleanup" echo "🕳️ Mole - Deeper system cleanup"
echo "=========================" echo "=================================================="
echo "" echo ""
echo "This will clean:" echo "This will clean:"
echo " • App caches and logs" echo " • App caches and logs"
@@ -336,7 +336,7 @@ start_cleanup() {
perform_cleanup() { perform_cleanup() {
echo "" echo ""
echo "🕳️ Mole - System Cleanup" echo "🕳️ Mole - Deeper system cleanup"
echo "========================" echo "========================"
echo "🍎 Detected: $(detect_architecture) | 💾 Free space: $(get_free_space)" echo "🍎 Detected: $(detect_architecture) | 💾 Free space: $(get_free_space)"
@@ -869,7 +869,7 @@ perform_cleanup() {
main() { main() {
case "${1:-""}" in case "${1:-""}" in
"--help"|"-h") "--help"|"-h")
echo "Mole - System Cleanup" echo "Mole - Deeper system cleanup"
echo "Usage: clean.sh [options]" echo "Usage: clean.sh [options]"
echo "" echo ""
echo "Options:" echo "Options:"
@@ -885,4 +885,4 @@ main() {
esac esac
} }
main "$@" main "$@"

22
mole
View File

@@ -25,8 +25,8 @@ source "$SCRIPT_DIR/lib/common.sh"
VERSION="1.0.0" VERSION="1.0.0"
show_help() { show_help() {
cat << EOF cat <<'EOF'
Mole v$VERSION - Dig deep to clean your mac. Mole can dig deep to clean your mac.
===================================== =====================================
USAGE: USAGE:
@@ -34,7 +34,7 @@ USAGE:
COMMANDS: COMMANDS:
mole # Interactive main menu mole # Interactive main menu
mole clean # Clean system (will ask for password if needed) mole clean # Deeper system cleanup
mole uninstall # Remove applications completely mole uninstall # Remove applications completely
mole --help # Show this help message mole --help # Show this help message
@@ -48,7 +48,7 @@ show_main_menu() {
if [[ "$redraw_full" == "true" ]]; then if [[ "$redraw_full" == "true" ]]; then
echo "" echo ""
echo " 🌚 Mole can dig deep to clean your mac." echo "Mole can dig deep to clean your mac."
echo "" echo ""
fi fi
@@ -74,6 +74,10 @@ interactive_main_menu() {
# Set up signal trapping to handle Ctrl+C gracefully # Set up signal trapping to handle Ctrl+C gracefully
trap 'echo ""; echo "Thank you for using Mole!"; exit 0' INT trap 'echo ""; echo "Thank you for using Mole!"; exit 0' INT
cleanup_menu_display() {
printf '\033[u\033[J'
}
while true; do while true; do
if [[ "$first_draw" == "true" ]]; then if [[ "$first_draw" == "true" ]]; then
show_main_menu $current_option true show_main_menu $current_option true
@@ -101,6 +105,7 @@ interactive_main_menu() {
((current_option < total_options)) && ((current_option++)) ((current_option < total_options)) && ((current_option++))
;; ;;
"ENTER") "ENTER")
cleanup_menu_display
case $current_option in case $current_option in
1) 1)
exec "$SCRIPT_DIR/bin/clean.sh" exec "$SCRIPT_DIR/bin/clean.sh"
@@ -109,10 +114,12 @@ interactive_main_menu() {
exec "$SCRIPT_DIR/bin/uninstall.sh" exec "$SCRIPT_DIR/bin/uninstall.sh"
;; ;;
3) 3)
clear_screen
show_help show_help
exit 0 exit 0
;; ;;
4) 4)
clear_screen
echo "" echo ""
echo "Thank you for using Mole!" echo "Thank you for using Mole!"
exit 0 exit 0
@@ -120,16 +127,19 @@ interactive_main_menu() {
esac esac
;; ;;
"QUIT"|"ESC") "QUIT"|"ESC")
cleanup_menu_display
clear_screen
echo "" echo ""
echo "Thank you for using Mole!" echo "Thank you for using Mole!"
exit 0 exit 0
;; ;;
"1"|"2"|"3"|"4") "1"|"2"|"3"|"4")
cleanup_menu_display
case $key in case $key in
1) exec "$SCRIPT_DIR/bin/clean.sh" ;; 1) exec "$SCRIPT_DIR/bin/clean.sh" ;;
2) exec "$SCRIPT_DIR/bin/uninstall.sh" ;; 2) exec "$SCRIPT_DIR/bin/uninstall.sh" ;;
3) show_help; exit 0 ;; 3) clear_screen; show_help; exit 0 ;;
4) echo ""; echo "Thank you for using Mole!"; exit 0 ;; 4) clear_screen; echo ""; echo "Thank you for using Mole!"; exit 0 ;;
esac esac
;; ;;
*) *)