Permalink
Browse files

Adding my modifications to installation script

  • Loading branch information...
1 parent dd1e57b commit 344fb4523cfeec1740bc89970844e1a7afbf4692 @swaroopch committed Jul 27, 2011
Showing with 66 additions and 76 deletions.
  1. +0 −76 install.bash
  2. +66 −0 install.sh
View
@@ -1,76 +0,0 @@
-#!/usr/bin/env 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
-
-# Assumption of directory location
-DOTBASH="$HOME/code/dotbash"
-cd $DOTBASH
-
-echo "Setting up bash profile."
-echo >> $PROFILE # Adding a new line for separation, in case last line does not end with a newline.
-echo "[ -s \"$DOTBASH/template/my_bash_profile.bash\" ] && source \"$DOTBASH/template/my_bash_profile.bash\"" >> $PROFILE
-
-echo "Setting up application-specific configs"
-ln -s -i "$DOTBASH/configs/tmux.conf" ~/.tmux.conf
-ln -s -i "$DOTBASH/configs/ackrc" ~/.ackrc
-ln -s -i "$DOTBASH/configs/irbrc" ~/.irbrc
-ln -s -i "$DOTBASH/configs/gitconfig" ~/.gitconfig
-cp -i "$DOTBASH/configs/gemrc.yml" ~/.gemrc
-
-cd $DOTBASH
-
-## XXX YOU MUST CHANGE THIS FOR YOUR OWN CUSTOM SETUP
-if [[ "$CUSTOM" == "yes" ]]
-then
- DOTBASH_CUSTOM="$HOME/code/dotbash_custom"
-
- if [[ ! -d "$DOTBASH_CUSTOM" ]]
- then
- mkdir -p "$DOTBASH_CUSTOM/.."
- cd "$DOTBASH_CUSTOM/.."
- # XXX THIS IS MY PRIVATE REPO. YOU CANNOT ACCESS THIS.
- git clone git@github.com:swaroopch/dotbash_custom.git
- else
- cd $DOTBASH
- git pull
- fi
-
- echo "Setting up custom configs"
- bash "$DOTBASH_CUSTOM/install.sh"
-fi
-
-echo "Finished. Open a new shell now!"
View
@@ -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
@@ -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
@@ -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.