[ZSH] Note update has happened

This commit is contained in:
Fabian Ising
2026-07-27 11:09:57 +02:00
committed by Fabian Ising
parent a44f109dc7
commit 06b0d9bc90
+7 -1
View File
@@ -10,7 +10,13 @@ update_dotfiles() {
$TO git -C "$repo" fetch --quiet </dev/null 2>/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