From dda3f1664631e5b51c01172d47699230f3d4859d Mon Sep 17 00:00:00 2001 From: Marc Egea i Sala Date: Sun, 28 Jul 2013 23:33:34 +0200 Subject: [PATCH] Permit custom dir for bash-it. --- install.sh | 4 ++-- template/bash_profile.template.bash | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/install.sh b/install.sh index 46edcf22..51bd9b6d 100755 --- a/install.sh +++ b/install.sh @@ -1,11 +1,11 @@ #!/usr/bin/env bash -BASH_IT="$HOME/.bash_it" +BASH_IT="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" test -w $HOME/.bash_profile && cp $HOME/.bash_profile $HOME/.bash_profile.bak && echo "Your original .bash_profile has been backed up to .bash_profile.bak" -cp $HOME/.bash_it/template/bash_profile.template.bash $HOME/.bash_profile +sed "s/__BASH_IT__/$(echo $BASH_IT | sed 's/\//\\\//g')/g" $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" diff --git a/template/bash_profile.template.bash b/template/bash_profile.template.bash index 60cac9ea..c381d347 100644 --- a/template/bash_profile.template.bash +++ b/template/bash_profile.template.bash @@ -7,7 +7,7 @@ export PATH=$PATH:~/.gem/ruby/1.8/bin:/opt/nginx/sbin # Path to the bash it configuration -export BASH_IT=$HOME/.bash_it +export BASH_IT=__BASH_IT__ # Lock and Load a custom theme file # location /.bash_it/themes/