Clone dotfiles in case of neovim

This commit is contained in:
Thomas Forgione 2019-04-26 15:32:43 +02:00
parent 6552a124c4
commit aa2404161c
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 21 additions and 14 deletions

View File

@ -104,6 +104,24 @@ git_clone() {
fi 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() { configure_zsh() {
yes_no_ask "do you wish to install and configure zsh ?" yes_no_ask "do you wish to install and configure zsh ?"
@ -112,16 +130,7 @@ configure_zsh() {
return return
fi fi
test_command git clone_dotfiles
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
test_command zsh test_command zsh
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
@ -139,10 +148,6 @@ configure_zsh() {
git_clone https://github.com/robbyrussell/oh-my-zsh/ $HOME/.config/oh-my-zsh git_clone https://github.com/robbyrussell/oh-my-zsh/ $HOME/.config/oh-my-zsh
fi fi
if [ ! -d $HOME/.config/dotfiles ]; then
git_clone https://gitea.tforgione.fr/tforgione/dotfiles/ $HOME/.config/dotfiles
fi
if [ -f $HOME/.zshrc ]; then if [ -f $HOME/.zshrc ]; then
path1=`realpath $HOME/.zshrc` path1=`realpath $HOME/.zshrc`
path2=`realpath $HOME/.config/dotfiles/zshrc` path2=`realpath $HOME/.config/dotfiles/zshrc`
@ -203,6 +208,8 @@ configure_neovim() {
return return
fi fi
clone_dotfiles
test_command nvim test_command nvim
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
info "installing neovim" info "installing neovim"