1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-04 12:06:45 +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