moss-n-puddles/.envrc
2025-01-22 07:58:32 -08:00

16 lines
601 B
Text

# use python 3.12
# check if python version is set in current dir
if [ -f ".python-version" ] ; then
if [ ! -d ".venv" ] ; then
echo "Installing virtualenv for $(python -V)"
# if we didn't install `py2venv` for python 2.x, we would need to use
# `virtualenv`, which you would have to install separately.
python -m venv .venv
fi
echo "Activating $(python -V) virtualenv"
source .venv/bin/activate
fi
# announce python version and show the path of the current python in ${PATH}
echo "Virtualenv has been activated for $(python -V)"
echo "$(which python)"