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:
19
bin/pgadmin4
19
bin/pgadmin4
@@ -2,10 +2,14 @@
|
||||
|
||||
PGADMINVENV="pgadmin4"
|
||||
VENVDIR="$HOME/.virtualenvs/${PGADMINVENV}"
|
||||
source /usr/share/virtualenvwrapper/virtualenvwrapper.sh
|
||||
|
||||
if [ ! -d "$VENVDIR" ] || [ ! -e ${VENVDIR}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py ]; then
|
||||
mkvirtualenv "${PGADMINVENV}"
|
||||
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
|
||||
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
|
||||
echo
|
||||
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 "echo "SERVER_MODE = False" >> ${VENVDIR}/lib/python2.7/site-packages/pgadmin4/config_local.py"
|
||||
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
|
||||
python ${VENVDIR}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py
|
||||
python "${VENVDIR}/lib/python2.7/site-packages/pgadmin4/pgAdmin4.py"
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user