mirror of
https://github.com/aquatix/dotfiles.git
synced 2025-12-07 00:05:10 +01:00
34 lines
1.4 KiB
Bash
Executable File
34 lines
1.4 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
PGADMINVENV="pgadmin4"
|
|
VENVDIR="$HOME/.virtualenvs/${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}"
|
|
echo "Downloading the wheel from https://www.pgadmin.org/download/pgadmin-4-python-wheel/ ..."
|
|
pip install https://ftp.postgresql.org/pub/pgadmin/pgadmin4/v1.6/pip/pgadmin4-1.6-py2.py3-none-any.whl
|
|
echo "SERVER_MODE = False" >> "${VENVDIR}/lib/python2.7/site-packages/pgadmin4/config_local.py"
|
|
fi
|
|
|
|
# Install
|
|
#echo
|
|
#echo "Download the wheel from https://www.pgadmin.org/download/pgadmin-4-python-wheel/"
|
|
#echo
|
|
#echo "Install with:"
|
|
#echo "workon 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
|
|
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"
|
|
fi
|