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