Test.env

From Noah.org
Revision as of 10:00, 3 February 2009 by Root (Talk | contribs) (New page: Category:Engineering <pre> #!/bin/sh # This setups up environment variables for testing. # This was originally created for setting up a private # PYTHONPATH before switching to virtua...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


#!/bin/sh
# This setups up environment variables for testing.
# This was originally created for setting up a private
# PYTHONPATH before switching to virtualenv, but
# this script could be handy for other applications.
# You may either source this or run this as a script.
# It is smart enough to work either way.

SOURCE_ARG=$_
# echo $$ $0 $SOURCE_ARG
ABS_PATH_HERE=`echo -n \`pwd\` ;( [ \`dirname \$SOURCE_ARG\` == '.' ] && echo ) || echo "/\`dirname \$SOURCE_ARG\`"`

case $0 in
    -*|sh*|bash*|ksh*)
        SOURCED=1
    ;;
    *)
        unset SOURCED
    ;;
esac

export PYTHONPATH=${ABS_PATH_HERE}
export PATH=$PATH:${ABS_PATH_HERE}/scripts

if [ $SOURCED ]; then
    return
else
    exec env $SHELL
fi