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

feat: bump version to 1.16.0 and normalize release tags in the installer for consistent version handling.

This commit is contained in:
Tw93
2025-12-29 20:31:14 +08:00
parent ac73c0c249
commit 3c38790d38
2 changed files with 16 additions and 3 deletions

View File

@@ -144,6 +144,9 @@ resolve_source_dir() {
if [[ -z "$branch" ]]; then
branch="main"
fi
if [[ "$branch" != "main" ]]; then
branch="$(normalize_release_tag "$branch")"
fi
local url="https://github.com/tw93/mole/archive/refs/heads/main.tar.gz"
# If a specific version is requested (e.g. V1.0.0), use the tag URL
@@ -233,6 +236,15 @@ get_latest_release_tag_from_git() {
tail -n 1
}
normalize_release_tag() {
local tag="$1"
tag="${tag#v}"
tag="${tag#V}"
if [[ -n "$tag" ]]; then
printf 'V%s\n' "$tag"
fi
}
get_installed_version() {
local binary="$INSTALL_DIR/mole"
if [[ -x "$binary" ]]; then

7
mole
View File

@@ -25,7 +25,7 @@ source "$SCRIPT_DIR/lib/core/common.sh"
trap cleanup_temp_files EXIT INT TERM
# Version info
VERSION="1.15.10"
VERSION="1.16.0"
MOLE_TAGLINE="Deep clean and optimize your Mac."
# Check TouchID configuration
@@ -430,11 +430,12 @@ update_mole() {
# Run installer with visible output (but capture for error handling)
local install_output
if install_output=$(MOLE_VERSION="V${latest}" "$tmp_installer" --prefix "$install_dir" --config "$HOME/.config/mole" --update 2>&1); then
local update_tag="V${latest#V}"
if install_output=$(MOLE_VERSION="$update_tag" "$tmp_installer" --prefix "$install_dir" --config "$HOME/.config/mole" --update 2>&1); then
process_install_output "$install_output"
else
# Retry without --update flag
if install_output=$(MOLE_VERSION="V${latest}" "$tmp_installer" --prefix "$install_dir" --config "$HOME/.config/mole" 2>&1); then
if install_output=$(MOLE_VERSION="$update_tag" "$tmp_installer" --prefix "$install_dir" --config "$HOME/.config/mole" 2>&1); then
process_install_output "$install_output"
else
if [[ -t 1 ]]; then stop_inline_spinner; fi