1
0
mirror of https://github.com/tw93/Mole.git synced 2026-03-22 22:30:08 +00:00

🎨 Version update prompt correction

This commit is contained in:
Tw93
2025-10-03 21:09:09 +08:00
parent 0211d5730e
commit e01301e065

6
mole
View File

@@ -59,14 +59,12 @@ check_for_updates() {
grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^[Vv]//')
fi
# Compare versions if fetch succeeded
if [[ -n "$latest_version" && "$latest_version" != "$VERSION" ]]; then
# Version mismatch - cache the update message
# Compare versions if fetch succeeded - only notify if latest is newer
if [[ -n "$latest_version" ]] && [[ "$(printf '%s\n' "$VERSION" "$latest_version" | sort -V | head -n1)" == "$VERSION" ]] && [[ "$VERSION" != "$latest_version" ]]; then
local msg="${YELLOW}📢 New version available: ${GREEN}${latest_version}${YELLOW} (current: ${VERSION})${NC}\n Run ${GREEN}mole update${YELLOW} to upgrade${NC}"
echo -e "$msg" > "$version_cache"
echo -e "$msg"
else
# Up to date or check failed - clear cache
echo "" > "$version_cache"
fi