update newbox script to work on rpm systems

This commit is contained in:
Sami Samhuri 2013-08-21 13:14:57 -07:00
parent 3983d45696
commit 2e636bc4f6

32
newbox
View file

@ -5,28 +5,30 @@ fail() {
exit 1
}
if ! which zsh >/dev/null 2>&1; then
install() {
# apt (debian / ubuntu)
if which aptitude >/dev/null 2>&1; then
sudo aptitude install -y zsh
sudo aptitude install -y "$@"
# homebrew (os x)
elif which brew >/dev/null 2>&1; then
brew install zsh
brew install "$@"
# rpm (redhat / centos / fedora)
elif which yum >/dev/null 2>&1; then
sudo yum install -y "$@"
else
fail "Don't know how to install zsh on this box. Install zsh and run this again."
fi
fail "Don't know how to install $@ on this box. Install $@ and run this again."
fi
if ! which git >/dev/null 2>&1; then
if which aptitude >/dev/null 2>&1; then
sudo aptitude install -y git-core
elif which brew >/dev/null 2>&1; then
brew install git-core
else
fail "Don't know how to install git on this box. Install git and run this again."
fi
fi
}
install zsh git
cd ~
if ! [ -d config ]; then
if ! [[ -d config ]]; then
git clone git://github.com/samsonjs/config || fail "cannot clone config repo"
fi