From aa2404161c81fabcbd1b03fc41233ad899631bbf Mon Sep 17 00:00:00 2001 From: Thomas Forgione Date: Fri, 26 Apr 2019 15:32:43 +0200 Subject: [PATCH] Clone dotfiles in case of neovim --- tforgione.sh | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/tforgione.sh b/tforgione.sh index a663e2d..f208371 100755 --- a/tforgione.sh +++ b/tforgione.sh @@ -104,6 +104,24 @@ git_clone() { fi } +clone_dotfiles() { + if [ ! -d $HOME/.config/dotfiles ]; then + + test_command git + if [ $? -ne 0 ]; then + if [ $sudo_available -ne 0 ]; then + error "git is needed, but you don't have git neither sudo" + return 1 + else + yes_no_ask_required "you'll need git for this, do you wish to install git ?" + install git + fi + fi + + git_clone https://gitea.tforgione.fr/tforgione/dotfiles/ $HOME/.config/dotfiles + fi +} + configure_zsh() { yes_no_ask "do you wish to install and configure zsh ?" @@ -112,16 +130,7 @@ configure_zsh() { return fi - test_command git - if [ $? -ne 0 ]; then - if [ $sudo_available -ne 0 ]; then - error "git is needed, but you don't have git neither sudo" - return 1 - else - yes_no_ask_required "you'll need git for this, do you wish to install git ?" - install git - fi - fi + clone_dotfiles test_command zsh if [ $? -ne 0 ]; then @@ -139,10 +148,6 @@ configure_zsh() { git_clone https://github.com/robbyrussell/oh-my-zsh/ $HOME/.config/oh-my-zsh fi - if [ ! -d $HOME/.config/dotfiles ]; then - git_clone https://gitea.tforgione.fr/tforgione/dotfiles/ $HOME/.config/dotfiles - fi - if [ -f $HOME/.zshrc ]; then path1=`realpath $HOME/.zshrc` path2=`realpath $HOME/.config/dotfiles/zshrc` @@ -203,6 +208,8 @@ configure_neovim() { return fi + clone_dotfiles + test_command nvim if [ $? -ne 0 ]; then info "installing neovim"