mirror of
https://github.com/tw93/Mole.git
synced 2026-03-22 21:20:09 +00:00
🎨 Version update prompt correction
This commit is contained in:
6
mole
6
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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user