From 5381c20411c4b491bf13dc1c8074ce54bd9f5e30 Mon Sep 17 00:00:00 2001 From: Michael Wesemann Date: Fri, 14 Aug 2026 10:55:20 +0200 Subject: [PATCH] extra.setup: make the fzf install repeatable and keep an existing zshrc git clone failed on every run after the first, and ~/.fzf/install asks three questions - both stop an unattended run. The rc file is not touched because extra/zshrc sources ~/.fzf.zsh itself. ~/.zshrc was overwritten without a copy; the first one seen is kept as ~/.zshrc.bak. Co-Authored-By: Claude Opus 5 --- extra.setup | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/extra.setup b/extra.setup index 2abce59..79d980d 100755 --- a/extra.setup +++ b/extra.setup @@ -26,9 +26,17 @@ system("curl -s https://ohmyposh.dev/install.sh | bash -s -- -d /db/bin"); system("mkdir -p /db/etc"); system("cp extra/omp.json /db/etc/"); -system("git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf"); -system("~/.fzf/install"); +if (-d "$HOME/.fzf") { + system("cd $HOME/.fzf && git pull --ff-only"); +} else { + system("git clone --depth 1 https://github.com/junegunn/fzf.git $HOME/.fzf"); +} +# The flags are what makes it run without asking. No --update-rc: the zshrc +# below sources ~/.fzf.zsh itself. +system("$HOME/.fzf/install --key-bindings --completion --no-update-rc"); -system("cp -r extra/zshrc $HOME/.zshrc"); +# Whatever zshrc is already there belongs to someone - keep the first one. +system("cp $HOME/.zshrc $HOME/.zshrc.bak") if (-f "$HOME/.zshrc" && !-f "$HOME/.zshrc.bak"); +system("cp extra/zshrc $HOME/.zshrc"); ########################################################################################################### END