From e01301e065cd5b22a09f08af5d05d86d173ce1c3 Mon Sep 17 00:00:00 2001 From: Tw93 Date: Fri, 3 Oct 2025 21:09:09 +0800 Subject: [PATCH] :art: Version update prompt correction --- mole | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/mole b/mole index fbeed4f..7cff0c6 100755 --- a/mole +++ b/mole @@ -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