mirror of
https://github.com/tw93/Mole.git
synced 2026-02-04 15:39:42 +00:00
Support the installation of dev branche
This commit is contained in:
@@ -35,7 +35,7 @@ brew install mole
|
|||||||
**or by Script, for older macOS or latest code:**
|
**or by Script, for older macOS or latest code:**
|
||||||
|
|
||||||
```bash
|
```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
|
curl -fsSL https://raw.githubusercontent.com/tw93/mole/main/install.sh | bash
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
18
install.sh
18
install.sh
@@ -112,12 +112,14 @@ resolve_source_dir() {
|
|||||||
if [[ -z "$branch" ]]; then
|
if [[ -z "$branch" ]]; then
|
||||||
branch="main"
|
branch="main"
|
||||||
fi
|
fi
|
||||||
if [[ "$branch" != "main" ]]; then
|
if [[ "$branch" != "main" && "$branch" != "dev" ]]; then
|
||||||
branch="$(normalize_release_tag "$branch")"
|
branch="$(normalize_release_tag "$branch")"
|
||||||
fi
|
fi
|
||||||
local url="https://github.com/tw93/mole/archive/refs/heads/main.tar.gz"
|
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"
|
url="https://github.com/tw93/mole/archive/refs/tags/${branch}.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -137,7 +139,8 @@ resolve_source_dir() {
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
stop_line_spinner
|
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."
|
log_error "Failed to fetch version ${branch}. Check if tag exists."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
@@ -252,6 +255,12 @@ parse_args() {
|
|||||||
version_token="$token"
|
version_token="$token"
|
||||||
unset 'args[$i]'
|
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]*)
|
[0-9]* | V[0-9]* | v[0-9]*)
|
||||||
export MOLE_VERSION="$token"
|
export MOLE_VERSION="$token"
|
||||||
version_token="$token"
|
version_token="$token"
|
||||||
@@ -653,7 +662,8 @@ perform_install() {
|
|||||||
if [[ "${MOLE_EDGE_INSTALL:-}" == "true" ]]; then
|
if [[ "${MOLE_EDGE_INSTALL:-}" == "true" ]]; then
|
||||||
installed_version="${installed_version}-edge"
|
installed_version="${installed_version}-edge"
|
||||||
echo ""
|
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"
|
log_info "This is a testing version; use 'mo update' to switch to stable"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user