mirror of
https://github.com/tw93/Mole.git
synced 2026-02-15 23:11:11 +00:00
🎨 Add cache whitelist for large models
This commit is contained in:
12
GUIDE.md
12
GUIDE.md
@@ -163,6 +163,18 @@ Mole 有智能保护机制:
|
||||
- 不会删除系统关键文件
|
||||
- 会跳过正在运行的应用
|
||||
- 清理前会显示即将删除的内容
|
||||
- 默认保护大型缓存(如 Playwright 浏览器、HuggingFace 模型等)
|
||||
|
||||
如果你有其他需要保护的文件,可以添加到白名单:
|
||||
|
||||
```bash
|
||||
# 查看默认保护的文件
|
||||
mole clean --whitelist
|
||||
|
||||
# 添加自定义保护
|
||||
mkdir -p ~/.config/mole
|
||||
echo '~/我的重要缓存/*' >> ~/.config/mole/whitelist
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -86,11 +86,11 @@ $ mole clean
|
||||
**Protect important files:**
|
||||
|
||||
```bash
|
||||
# View whitelist
|
||||
# View default whitelist (Playwright browsers, HuggingFace models, etc.)
|
||||
mole clean --whitelist
|
||||
|
||||
# Add protection
|
||||
echo '~/Library/Caches/ms-playwright*' >> ~/.config/mole/whitelist
|
||||
# Add custom protection
|
||||
echo '~/my-important-cache/*' >> ~/.config/mole/whitelist
|
||||
```
|
||||
|
||||
### 🗑️ Smart App Uninstaller
|
||||
@@ -150,6 +150,7 @@ Total: 156.8GB
|
||||
- System-critical files like Input Methods, Dock, and System Preferences
|
||||
- User data from IDEs like JetBrains DataGrip and VS Code, plus database tools
|
||||
- License data from paid apps like 1Password and Adobe products
|
||||
- Large downloaded caches like Playwright browsers and HuggingFace models
|
||||
- App settings are only removed when you explicitly uninstall the app
|
||||
2. **Can I undo cleanup operations?** - Cache files are safe to delete and will regenerate automatically. For important data protection, use the whitelist feature via `mole clean --whitelist`.
|
||||
3. **How often should I run cleanup?** - Once a month is sufficient. Run when disk space is low.
|
||||
|
||||
@@ -13,7 +13,10 @@ SYSTEM_CLEAN=false
|
||||
DRY_RUN=false
|
||||
IS_M_SERIES=$([ "$(uname -m)" = "arm64" ] && echo "true" || echo "false")
|
||||
# Default whitelist patterns to avoid removing critical caches (can be extended by user)
|
||||
WHITELIST_PATTERNS=("$HOME/Library/Caches/ms-playwright*")
|
||||
WHITELIST_PATTERNS=(
|
||||
"$HOME/Library/Caches/ms-playwright*"
|
||||
"$HOME/.cache/huggingface*"
|
||||
)
|
||||
# Load user-defined whitelist file if present (~/.config/mole/whitelist)
|
||||
if [[ -f "$HOME/.config/mole/whitelist" ]]; then
|
||||
while IFS= read -r line; do
|
||||
|
||||
Reference in New Issue
Block a user