Skip to content

Commit

Permalink
update setup.sh to be source-able from other locations in bash shells
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Jan 14, 2013
1 parent 1194b5e commit 5aff8fe
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,13 @@
export PATH=`pwd`/scripts:$PATH
export PYTHONPATH=`pwd`:$PYTHONPATH
if [ "$BASH_SOURCE" ]; then
BASEDIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
else
SCRIPT=$(readlink -f $0)
BASEDIR=$(dirname $SCRIPT)
if [ ! -f "$BASEDIR/setup.sh" ]; then
echo "In non-bash shells the setup.sh file must be sourced from the same directory"
return 1
fi
fi

export PATH=$BASEDIR/scripts:$PATH
export PYTHONPATH=$BASEDIR:$PYTHONPATH

0 comments on commit 5aff8fe

Please sign in to comment.