-
Notifications
You must be signed in to change notification settings - Fork 5
/
activate_devel_env
18 lines (18 loc) · 1.38 KB
/
activate_devel_env
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
PYTHON=""
PYTHON3=""
[[ -x $HOME/devel/venv/bin/python ]] && PYTHON=$HOME/devel/venv/bin/python
[[ -x $HOME/devel/venv/bin/python2 ]] && PYTHON=$HOME/devel/venv/bin/python2
[[ -x $HOME/devel/venv/bin/python3 ]] && PYTHON3=$HOME/devel/venv/bin/python3
for pkg in clodoo devel_tools lisa odoo_score os0 python_plus travis_emulator wok_code zar z0bug_odoo z0lib zerobug;do
[[ ! -d $HOME/devel/pypi/$pkg/$pkg || :$PATH: =~ :$HOME/devel/pypi/$pkg/$pkg: ]] || export PATH=$HOME/devel/pypi/$pkg/$pkg:$PATH
[[ ! -d $HOME/devel/pypi/$pkg/$pkg || :$PYTHONPATH: =~ :$HOME/devel/pypi/$pkg: ]] || export PYTHONPATH=$HOME/devel/pypi/$pkg:$PYTHONPATH
if [[ ! $HOSTNAME =~ shs ]]; then
for f in $HOME/devel/pypi/$pkg/$pkg/*; do
[[ ( -x $f || $f =~ .py$ ) && ! -d $f ]] && grep -q "^#\!.*/bin.*python3$" $f &>/dev/null && sed -i -e "s|^#\!.*/bin.*python3|#\!$PYTHON3|" $f && echo "sed -i -e \"s|^#\!.*/bin.*python3|#\!$PYTHON3|\" $f"
[[ ( -x $f || $f =~ .py$ ) && ! -d $f ]] && grep -q "^#\!.*/bin.*python2$" $f &>/dev/null && sed -i -e "s|^#\!.*/bin.*python2|#\!$PYTHON|" $f && echo "sed -i -e \"s|^#\!.*/bin.*python2|#\!$PYTHON|\" $f"
[[ ( -x $f || $f =~ .py$ ) && ! -d $f ]] && grep -q "^#\!.*/bin.*python$" $f &>/dev/null && sed -i -e "s|^#\!.*/bin.*python|#\!$PYTHON|" $f && echo "sed -i -e \"s|^#\!.*/bin.*python|#\!$PYTHON|\" $f"
done
fi
done
echo "PATH=$PATH"
echo "PYTHONPATH=$PYTHONPATH"