1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 13:16:47 +00:00

📝 Update instructions

This commit is contained in:
Tw93
2025-10-04 07:26:42 +08:00
parent 0db510244d
commit 41178b9cc1
4 changed files with 27 additions and 0 deletions

View File

@@ -53,6 +53,8 @@ brew install tw93/tap/mole
> 💡 什么是 Homebrew一个 Mac 软件管理工具。如果你不知道这是什么,请使用方法一。
> ⚠️ **重要:** 只选择一种方法安装!不要同时用两种方法,会产生冲突。
> ⚠️ 注意:第一次安装可能会要求你输入 Mac 的登录密码(输入时不会显示任何字符,这是正常的)
---
@@ -167,11 +169,13 @@ Mole 有智能保护机制:
### 如何更新 Mole
**如果是一键安装的:**
```bash
mole update
```
**如果是 Homebrew 安装的:**
```bash
brew upgrade mole
```

View File

@@ -23,6 +23,8 @@ Or via Homebrew:
brew install tw93/tap/mole
```
> ⚠️ **Note:** Choose one installation method. Don't mix both to avoid conflicts.
> 📖 **不会用终端?** 查看 [小白使用指南](./GUIDE.md) 了解详细的教程
## Usage

View File

@@ -169,6 +169,17 @@ check_requirements() {
exit 1
fi
# Check if already installed via Homebrew
if command -v brew >/dev/null 2>&1 && brew list mole >/dev/null 2>&1; then
log_warning "Mole is already installed via Homebrew"
echo ""
echo "Please choose one installation method:"
echo " 1. Keep Homebrew version (recommended): brew upgrade mole"
echo " 2. Switch to manual install: brew uninstall mole && then re-run this script"
echo ""
exit 1
fi
# Check if install directory exists and is writable
if [[ ! -d "$(dirname "$INSTALL_DIR")" ]]; then
log_error "Parent directory $(dirname "$INSTALL_DIR") does not exist"

10
mole
View File

@@ -139,6 +139,16 @@ show_help() {
# Simple update function
update_mole() {
# Check if installed via Homebrew
if command -v brew >/dev/null 2>&1 && brew list mole >/dev/null 2>&1; then
echo -e "${YELLOW}Mole is installed via Homebrew${NC}"
echo ""
echo "Please use Homebrew to update:"
echo -e " ${GREEN}brew upgrade mole${NC}"
echo ""
exit 0
fi
log_info "Updating Mole..."
local installer_url="https://raw.githubusercontent.com/tw93/mole/main/install.sh"