Skip to content
This repository has been archived by the owner on Dec 26, 2020. It is now read-only.

Commit

Permalink
Adding my modifications to installation script
Browse files Browse the repository at this point in the history
  • Loading branch information
swaroopch committed Jul 27, 2011
1 parent dd1e57b commit 344fb45
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 76 deletions.
76 changes: 0 additions & 76 deletions install.bash

This file was deleted.

66 changes: 66 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
#!/usr/bin/env bash
BASH="$HOME/.bash_it"
cd $BASH

## Check Bash Version

if [ "$BASH_VERSION" = "" ]
then
echo "I work only with Bash"
exit 1
fi

## Check Git is installed
if [[ $(which git) == "" ]]
then
echo "Please ensure that git is installed"
exit 1
fi

## Check OS

if [[ "$OSTYPE" == "darwin10.0" ]]
then
export OS="mac"
elif [[ "$OSTYPE" == "linux-gnu" ]]
then
export OS="linux"
else
echo "Don't know what to do with '$OSTYPE' operating system"
exit 1
fi

# Select correct user profile script
if [[ "$OS" == "mac" ]]
then
PROFILE="$HOME/.profile"
else
PROFILE="$HOME/.bashrc"
fi

cp $HOME/.bash_profile $HOME/.bash_profile.bak

Expand All @@ -9,6 +46,13 @@ cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/.bash_profile

echo "Copied the template .bash_profile into ~/.bash_profile, edit this file to customize bash-it"

echo "Setting up application-specific configs"
ln -s -i "$BASH/configs/tmux.conf" ~/.tmux.conf
ln -s -i "$BASH/configs/ackrc" ~/.ackrc
ln -s -i "$BASH/configs/irbrc" ~/.irbrc
ln -s -i "$BASH/configs/gitconfig" ~/.gitconfig
cp -i "$BASH/configs/gemrc.yml" ~/.gemrc

while true
do
read -p "Do you use Jekyll? (If you don't know what Jekyll is, answer 'n') [Y/N] " RESP
Expand Down Expand Up @@ -86,3 +130,25 @@ do
esac
done
done

## XXX YOU MUST CHANGE THIS FOR YOUR OWN CUSTOM SETUP
if [[ "$CUSTOM" == "yes" ]]
then
BASH_CUSTOM="$HOME/code/dotbash_custom"

if [[ ! -d "$BASH_CUSTOM" ]]
then
mkdir -p "$BASH_CUSTOM/.."
cd "$BASH_CUSTOM/.."
# XXX THIS IS MY PRIVATE REPO. YOU CANNOT ACCESS THIS.
git clone git@github.com:swaroopch/BASH_custom.git
else
cd $BASH
git pull
fi

echo "Setting up custom configs"
bash "$BASH_CUSTOM/install.sh"
fi

echo "Finished. Open a new shell now!"

0 comments on commit 344fb45

Please sign in to comment.