1
0
mirror of https://github.com/tw93/Mole.git synced 2026-02-10 10:14:23 +00:00

Fix update output version parsing

This commit is contained in:
Tw93
2026-01-23 23:28:27 +08:00
parent b0f9761458
commit c0596f51e3
2 changed files with 26 additions and 11 deletions

7
mole
View File

@@ -13,7 +13,7 @@ source "$SCRIPT_DIR/lib/core/commands.sh"
trap cleanup_temp_files EXIT INT TERM
# Version and update helpers
VERSION="1.23.1"
VERSION="1.23.2"
MOLE_TAGLINE="Deep clean and optimize your Mac."
is_touchid_configured() {
@@ -347,7 +347,10 @@ update_mole() {
if ! printf '%s\n' "$output" | grep -Eq "Updated to latest version|Already on latest version"; then
local new_version
new_version=$("$mole_path" --version 2> /dev/null | awk 'NR==1 && NF {print $NF}' || echo "")
new_version=$(printf '%s\n' "$output" | sed -n 's/.*(version \([^)]*\)).*/\1/p' | head -1)
if [[ -z "$new_version" ]]; then
new_version=$("$mole_path" --version 2> /dev/null | awk 'NR==1 && NF {print $NF}' || echo "")
fi
if [[ -z "$new_version" ]]; then
new_version="$fallback_version"
fi