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

Support the installation of dev branche

This commit is contained in:
Tw93
2026-01-03 09:40:53 +08:00
parent 8f388ace46
commit a0be298bfc
2 changed files with 15 additions and 5 deletions

View File

@@ -35,7 +35,7 @@ brew install mole
**or by Script, for older macOS or latest code:**
```bash
# Use for older macOS or latest code; add '-s latest' for newest, or '-s 1.17.0' for a fixed version.
# Add '-s latest' for newest, '-s dev' for development, or '-s 1.17.0' for a version.
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
```

View File

@@ -112,12 +112,14 @@ resolve_source_dir() {
if [[ -z "$branch" ]]; then
branch="main"
fi
if [[ "$branch" != "main" ]]; then
if [[ "$branch" != "main" && "$branch" != "dev" ]]; then
branch="$(normalize_release_tag "$branch")"
fi
local url="https://github.com/tw93/mole/archive/refs/heads/main.tar.gz"
if [[ "$branch" != "main" ]]; then
if [[ "$branch" == "dev" ]]; then
url="https://github.com/tw93/mole/archive/refs/heads/dev.tar.gz"
elif [[ "$branch" != "main" ]]; then
url="https://github.com/tw93/mole/archive/refs/tags/${branch}.tar.gz"
fi
@@ -137,7 +139,8 @@ resolve_source_dir() {
fi
else
stop_line_spinner
if [[ "$branch" != "main" ]]; then
# Only exit early for version tags (not for main/dev branches)
if [[ "$branch" != "main" && "$branch" != "dev" ]]; then
log_error "Failed to fetch version ${branch}. Check if tag exists."
exit 1
fi
@@ -252,6 +255,12 @@ parse_args() {
version_token="$token"
unset 'args[$i]'
;;
dev)
export MOLE_VERSION="dev"
export MOLE_EDGE_INSTALL="true"
version_token="$token"
unset 'args[$i]'
;;
[0-9]* | V[0-9]* | v[0-9]*)
export MOLE_VERSION="$token"
version_token="$token"
@@ -653,7 +662,8 @@ perform_install() {
if [[ "${MOLE_EDGE_INSTALL:-}" == "true" ]]; then
installed_version="${installed_version}-edge"
echo ""
log_warning "Edge version installed on main branch"
local branch_name="${MOLE_VERSION:-main}"
log_warning "Edge version installed on ${branch_name} branch"
log_info "This is a testing version; use 'mo update' to switch to stable"
fi