From 61a11c914eaa568b313b6528ab592859904e62e7 Mon Sep 17 00:00:00 2001 From: Matijs Brinkhuis Date: Tue, 27 Sep 2011 22:58:44 +0300 Subject: make it possible for bootstap.sh to be executed from wherever --- bootstrap.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index d94b378..49c0ad1 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,7 +1,11 @@ +currentdir=`pwd` +dotdir=`dirname $0` +cd $dotdir git pull read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1 echo if [[ $REPLY =~ ^[Yy]$ ]]; then rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" --exclude "README.md" -av . ~ fi -source "$HOME/.bash_profile" \ No newline at end of file +source "$HOME/.bash_profile" +cd $currentdir \ No newline at end of file -- cgit v1.2.3 From 37301ad41aa1d3496e56f57d76b01d5e5297cda9 Mon Sep 17 00:00:00 2001 From: Matijs Brinkhuis Date: Wed, 28 Sep 2011 15:29:37 +0300 Subject: Undid some silly mistakes and made the script more simplerder --- bootstrap.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index 49c0ad1..a359fa6 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,11 +1,9 @@ -currentdir=`pwd` -dotdir=`dirname $0` -cd $dotdir +#!/bin/bash +cd "$(dirname "$0")"; git pull read -p "This may overwrite existing files in your home directory. Are you sure? (y/n) " -n 1 echo if [[ $REPLY =~ ^[Yy]$ ]]; then rsync --exclude ".git/" --exclude ".DS_Store" --exclude "bootstrap.sh" --exclude "README.md" -av . ~ fi -source "$HOME/.bash_profile" -cd $currentdir \ No newline at end of file +source "$HOME/.bash_profile" \ No newline at end of file -- cgit v1.2.3