Skip to content

Commit e186086

Browse files
committed
Fix handing issue on macOS Sequoia after completing 1 task (#291)
1 parent d45423d commit e186086

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

mole

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,20 +82,21 @@ check_for_updates() {
8282
ensure_user_file "$msg_cache"
8383

8484
(
85-
local latest
85+
(
86+
local latest
8687

87-
latest=$(get_latest_version_from_github)
88-
if [[ -z "$latest" ]]; then
89-
latest=$(get_latest_version)
90-
fi
88+
latest=$(get_latest_version_from_github)
89+
if [[ -z "$latest" ]]; then
90+
latest=$(get_latest_version)
91+
fi
9192

92-
if [[ -n "$latest" && "$VERSION" != "$latest" && "$(printf '%s\n' "$VERSION" "$latest" | sort -V | head -1)" == "$VERSION" ]]; then
93-
printf "\nUpdate available: %s → %s, run %smo update%s\n\n" "$VERSION" "$latest" "$GREEN" "$NC" > "$msg_cache"
94-
else
95-
echo -n > "$msg_cache"
96-
fi
97-
) &
98-
disown 2> /dev/null || true
93+
if [[ -n "$latest" && "$VERSION" != "$latest" && "$(printf '%s\n' "$VERSION" "$latest" | sort -V | head -1)" == "$VERSION" ]]; then
94+
printf "\nUpdate available: %s → %s, run %smo update%s\n\n" "$VERSION" "$latest" "$GREEN" "$NC" > "$msg_cache"
95+
else
96+
echo -n > "$msg_cache"
97+
fi
98+
) > /dev/null 2>&1 < /dev/null &
99+
)
99100
}
100101

101102
show_update_notification() {

0 commit comments

Comments
 (0)