diff --git a/zsh/lib/updates.zsh b/zsh/lib/updates.zsh index 4021a4f..c76d11a 100644 --- a/zsh/lib/updates.zsh +++ b/zsh/lib/updates.zsh @@ -10,7 +10,13 @@ update_dotfiles() { $TO git -C "$repo" fetch --quiet /dev/null || return git -C "$repo" rev-parse --abbrev-ref '@{u}' >/dev/null 2>&1 || return git -C "$repo" merge-base --is-ancestor '@{u}' HEAD 2>/dev/null && return - git -C "$repo" merge --ff-only --quiet '@{u}' 2>/dev/null && return + if git -C "$repo" merge --ff-only --quiet '@{u}' 2>/dev/null; then + local notice="⬆ dotfiles updated — run: exec zsh" + mkdir -p "$cache_dir" || return + print -r -- "$notice" >| "$notice_tmp" || return + mv -f "$notice_tmp" "$notice_file" + return + fi local notice="⚠ dotfiles: $(git -C "$repo" symbolic-ref --short HEAD) can't fast-forward to @{u} — run: git -C ~/dotfiles pull" mkdir -p "$cache_dir" || return print -r -- "$notice" >| "$notice_tmp" || return