2 ms·
I personally just settled on adding stuff into $debian_chroot; it's not what it was meant for, of course, but it means I don't have to customise my dotfiles.
by Joker_vD 2y ago
I personally just settled on adding stuff into $debian_chroot; it's not what it was meant for, of course, but it means I don't have to customise my dotfiles.
#!/bin/bash -e
VIRTUAL_ENV="$(realpath "$1")"
export VIRTUAL_ENV
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
unset PYTHONHOME
venv="$(basename "$VIRTUAL_ENV")"
if [ "$venv" = ".venv" ] ; then
venv="$(basename "$(dirname "$VIRTUAL_ENV")")"
fi
if [ -n "$venv" ] ; then
debian_chroot="$venv${debian_chroot:+|$debian_chroot}"
export debian_chroot
fi
exec "$SHELL"