Fix install_git/git_install mixup.

This commit is contained in:
David Tomaschik
2015-11-17 23:53:33 -08:00
parent 4858e33ff1
commit dd4beff725

View File

@@ -4,27 +4,22 @@ set nounset
set errexit set errexit
function prerequisites { function prerequisites {
# Prerequisites require git
if ! which git > /dev/null ; then
echo 'No git, not installing extras.' 1>&2
return
fi
if which zsh > /dev/null ; then if which zsh > /dev/null ; then
if [[ `getent passwd $USER | cut -d: -f7` != */zsh ]] ; then if [[ `getent passwd $USER | cut -d: -f7` != */zsh ]] ; then
echo 'Enter password to change shell.' 1>&2 echo 'Enter password to change shell.' 1>&2
chsh -s `which zsh` chsh -s `which zsh`
fi fi
git_install https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh install_git https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
else else
echo "ZSH not found!" > /dev/stderr echo "ZSH not found!" > /dev/stderr
fi fi
if which vim > /dev/null ; then if which vim > /dev/null ; then
mkdir -p $HOME/.vim/bundle mkdir -p $HOME/.vim/bundle
git_install https://github.com/VundleVim/Vundle.vim.git \ install_git https://github.com/VundleVim/Vundle.vim.git \
$HOME/.vim/bundle/Vundle.vim $HOME/.vim/bundle/Vundle.vim
fi fi
if which gdb > /dev/null ; then if which gdb > /dev/null ; then
git_install https://github.com/longld/peda.git $HOME/.peda install_git https://github.com/longld/peda.git $HOME/.peda
fi fi
} }
@@ -58,6 +53,9 @@ function install_basic_dir {
function install_git { function install_git {
# Install or update a git repository # Install or update a git repository
if ! which git > /dev/null ; then
return 1
fi
local REPO="${1}" local REPO="${1}"
local DESTDIR="${2}" local DESTDIR="${2}"
if [[ -d ${DESTDIR}/.git ]] ; then if [[ -d ${DESTDIR}/.git ]] ; then