Skip to content

Commit

Permalink
Merge pull request #777 from bronzehedwick/patch-1
Browse files Browse the repository at this point in the history
Preliminary support for neovim
  • Loading branch information
Johnny Robeson committed Sep 2, 2015
2 parents 851f2ac + 9f78da8 commit 748e494
Showing 1 changed file with 20 additions and 4 deletions.
24 changes: 20 additions & 4 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,21 @@ debug() {

program_exists() {
local ret='0'
type $1 >/dev/null 2>&1 || { local ret='1'; }
command -v $1 >/dev/null 2>&1 || { local ret='1'; }

# fail on non-zero return value
if [ "$ret" -ne 0 ]; then
return 1
fi

return 0
}

program_must_exist() {
program_exists $1

# throw error on non-zero return value
if [ ! "$ret" -eq '0' ]; then
if [ "$?" -ne 0 ]; then
error "You must have '$1' installed to continue."
fi
}
Expand Down Expand Up @@ -115,6 +126,11 @@ create_symlinks() {
lnif "$source_path/.vimrc.before" "$target_path/.vimrc.before"
lnif "$source_path/.vim" "$target_path/.vim"

if program_exists "nvim"; then
lnif "$source_path/.vim" "$target_path/.nvim"
lnif "$source_path/.vimrc" "$target_path/.nvim/nvimrc"
fi

touch "$target_path/.vimrc.local"

ret="$?"
Expand Down Expand Up @@ -160,8 +176,8 @@ setup_vundle() {

############################ MAIN()
variable_set "$HOME"
program_exists "vim"
program_exists "git"
program_must_exist "vim"
program_must_exist "git"

do_backup "$HOME/.vim" \
"$HOME/.vimrc" \
Expand Down

0 comments on commit 748e494

Please sign in to comment.