added a script .env_deactivate which lives at the base bin/git dir and .env_activate which lives in each git projects dir. these files should be renamde to .env to allow python autoenv to do its magic
This commit is contained in:
parent
729981e578
commit
c05aa86da1
2 changed files with 22 additions and 0 deletions
10
extra/.env_activate
Normal file
10
extra/.env_activate
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
PWD=`pwd`
|
||||||
|
BASE_PATH="${PWD}/env"
|
||||||
|
|
||||||
|
if [[ "${BASE_PATH}" == "${PWD}/env" ]]
|
||||||
|
then
|
||||||
|
if [[ -e env/bin/activate ]]
|
||||||
|
then
|
||||||
|
source env/bin/activate
|
||||||
|
fi
|
||||||
|
fi
|
12
extra/.env_deactivate
Normal file
12
extra/.env_deactivate
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
BASE_PATH=`dirname "${BASH_SOURCE}"`
|
||||||
|
PWD=`pwd`
|
||||||
|
|
||||||
|
if [[ "${BASE_PATH}" == "${PWD}" ]]
|
||||||
|
then
|
||||||
|
declare -f -F deactivate &>/dev/null
|
||||||
|
|
||||||
|
if [[ "${?}" == "0" ]]
|
||||||
|
then
|
||||||
|
deactivate
|
||||||
|
fi
|
||||||
|
fi
|
Loading…
Add table
Reference in a new issue