|
@@ -0,0 +1,55 @@
|
|
|
+if [[ "${BASH_SOURCE-}" = "$0" ]]; then
|
|
|
+ echo "You must source this script: \$ source $0" >&2
|
|
|
+ exit 33
|
|
|
+fi
|
|
|
+
|
|
|
+deactivate (){
|
|
|
+ # reset old environment variables
|
|
|
+ # ! [ -z ${VAR+_} ] returns true if VAR is declared at all
|
|
|
+ if ! [ -z "${_OLD_VIRTUAL_PATH:+_}" ] ; then
|
|
|
+ PATH="$_OLD_VIRTUAL_PATH"
|
|
|
+ export PATH
|
|
|
+ unset _OLD_VIRTUAL_PATH
|
|
|
+ fi
|
|
|
+ if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
|
|
+ hash -r 2>/dev/null
|
|
|
+ fi
|
|
|
+
|
|
|
+ if ! [ -z "${_OLD_VIRTUAL_PS1+_}" ] ; then
|
|
|
+ PS1="$_OLD_VIRTUAL_PS1"
|
|
|
+ export PS1
|
|
|
+ unset _OLD_VIRTUAL_PS1
|
|
|
+ fi
|
|
|
+
|
|
|
+ unset VIRTUAL_ENV
|
|
|
+ if [ ! "${1-}" = "nondestructive" ] ; then
|
|
|
+ # Self destruct!
|
|
|
+ unset -f deactivate
|
|
|
+ fi
|
|
|
+}
|
|
|
+
|
|
|
+NODE_ENV="`pwd`/node_modules/.bin"
|
|
|
+export NODE_ENV
|
|
|
+
|
|
|
+_OLD_VIRTUAL_PATH="$PATH"
|
|
|
+
|
|
|
+PATH="$NODE_ENV:$PATH"
|
|
|
+export PATH
|
|
|
+
|
|
|
+if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT-}" ] ; then
|
|
|
+ _OLD_VIRTUAL_PS1="${PS1-}"
|
|
|
+ if [ "x" != x ] ; then
|
|
|
+ PS1="${PS1-}"
|
|
|
+ else
|
|
|
+ PWD=`pwd`
|
|
|
+ PS1="(`basename $PWD`) ${PS1-}"
|
|
|
+ fi
|
|
|
+ export PS1
|
|
|
+fi
|
|
|
+
|
|
|
+# This should detect bash and zsh, which have a hash command that must
|
|
|
+# be called to get it to forget past commands. Without forgetting
|
|
|
+# past commands the $PATH changes we made may not be respected
|
|
|
+if [ -n "${BASH-}" ] || [ -n "${ZSH_VERSION-}" ] ; then
|
|
|
+ hash -r 2>/dev/null
|
|
|
+fi
|