mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 13:35:42 -07:00
Wrap git install to also update.
This commit is contained in:
21
install.sh
21
install.sh
@@ -14,21 +14,17 @@ function prerequisites {
|
||||
echo 'Enter password to change shell.' 1>&2
|
||||
chsh -s `which zsh`
|
||||
fi
|
||||
if [[ ! -d $HOME/.oh-my-zsh ]] ; then
|
||||
git clone https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
|
||||
fi
|
||||
git_install https://github.com/robbyrussell/oh-my-zsh.git $HOME/.oh-my-zsh
|
||||
else
|
||||
echo "ZSH not found!" > /dev/stderr
|
||||
fi
|
||||
if which vim > /dev/null ; then
|
||||
mkdir -p $HOME/.vim/bundle
|
||||
if [[ ! -d $HOME/.vim/bundle/Vundle.vim ]] ; then
|
||||
git clone https://github.com/VundleVim/Vundle.vim.git \
|
||||
git_install https://github.com/VundleVim/Vundle.vim.git \
|
||||
$HOME/.vim/bundle/Vundle.vim
|
||||
fi
|
||||
fi
|
||||
if which gdb > /dev/null ; then
|
||||
git clone https://github.com/longld/peda.git $HOME/.peda
|
||||
git_install https://github.com/longld/peda.git $HOME/.peda
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -60,6 +56,17 @@ function install_basic_dir {
|
||||
done
|
||||
}
|
||||
|
||||
function install_git {
|
||||
# Install or update a git repository
|
||||
local REPO="${1}"
|
||||
local DESTDIR="${2}"
|
||||
if [[ -d ${DESTDIR}/.git ]] ; then
|
||||
( cd ${DESTDIR} ; git pull -q )
|
||||
else
|
||||
git clone ${REPO} ${DESTDIR}
|
||||
fi
|
||||
}
|
||||
|
||||
function postinstall {
|
||||
# Install Vundle plugins
|
||||
if [[ -d $HOME/.vim/bundle/Vundle.vim ]] ; then
|
||||
|
||||
Reference in New Issue
Block a user