1
0
mirror of https://github.com/aquatix/dotfiles.git synced 2025-12-07 00:05:10 +01:00

Check on active venv; quote some paths

This commit is contained in:
2017-09-05 15:40:32 +02:00
parent f6b479303e
commit da61de2efd

View File

@@ -2,10 +2,14 @@
PGADMINVENV="pgadmin4" PGADMINVENV="pgadmin4"
VENVDIR="$HOME/.virtualenvs/${PGADMINVENV}" VENVDIR="$HOME/.virtualenvs/${PGADMINVENV}"
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
if [ ! -d "$VENVDIR" ] || [ ! -e ${VENVDIR}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py ]; then if [ ! -d "$VENVDIR" ] || [ ! -e "${VENVDIR}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py" ] || [ ! -e "${VENVDIR}/lib/python2.7/site-packages/pgadmin4/config_local.py" ]; then
mkvirtualenv "${PGADMINVENV}" if [[ -z "$VIRTUAL_ENV" ]]; then
# Only activate the virtualenv if we aren't in one already
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
mkvirtualenv "${PGADMINVENV}"
fi
# Install # Install
echo echo
echo "Download the wheel from https://www.pgadmin.org/download/pgadmin-4-python-wheel/" echo "Download the wheel from https://www.pgadmin.org/download/pgadmin-4-python-wheel/"
@@ -15,7 +19,12 @@ if [ ! -d "$VENVDIR" ] || [ ! -e ${VENVDIR}/lib/python2.7/site-packages/pgadmin4
echo "pip install ./pgadmin4-1.6-py2.py3-none-any.whl" echo "pip install ./pgadmin4-1.6-py2.py3-none-any.whl"
echo "echo "SERVER_MODE = False" >> ${VENVDIR}/lib/python2.7/site-packages/pgadmin4/config_local.py" echo "echo "SERVER_MODE = False" >> ${VENVDIR}/lib/python2.7/site-packages/pgadmin4/config_local.py"
else else
workon "${PGADMINVENV}" if [[ -z "$VIRTUAL_ENV" ]]; then
# Only activate the virtualenv if we aren't in one already
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
workon "${PGADMINVENV}"
fi
# Start # Start
python ${VENVDIR}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py python "${VENVDIR}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py"
fi fi