From e186086578378a6c4c7297130517e7747705cb8a Mon Sep 17 00:00:00 2001 From: Tw93 Date: Sun, 11 Jan 2026 08:11:43 +0800 Subject: [PATCH] Fix handing issue on macOS Sequoia after completing 1 task (#291) --- mole | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/mole b/mole index 8d29329..b7e3bc6 100755 --- a/mole +++ b/mole @@ -82,20 +82,21 @@ check_for_updates() { ensure_user_file "$msg_cache" ( - local latest + ( + local latest - latest=$(get_latest_version_from_github) - if [[ -z "$latest" ]]; then - latest=$(get_latest_version) - fi + latest=$(get_latest_version_from_github) + if [[ -z "$latest" ]]; then + latest=$(get_latest_version) + fi - if [[ -n "$latest" && "$VERSION" != "$latest" && "$(printf '%s\n' "$VERSION" "$latest" | sort -V | head -1)" == "$VERSION" ]]; then - printf "\nUpdate available: %s → %s, run %smo update%s\n\n" "$VERSION" "$latest" "$GREEN" "$NC" > "$msg_cache" - else - echo -n > "$msg_cache" - fi - ) & - disown 2> /dev/null || true + if [[ -n "$latest" && "$VERSION" != "$latest" && "$(printf '%s\n' "$VERSION" "$latest" | sort -V | head -1)" == "$VERSION" ]]; then + printf "\nUpdate available: %s → %s, run %smo update%s\n\n" "$VERSION" "$latest" "$GREEN" "$NC" > "$msg_cache" + else + echo -n > "$msg_cache" + fi + ) > /dev/null 2>&1 < /dev/null & + ) } show_update_notification() {