steamos-venv-pre-commit.bash: verify pypy{,3} doesn't exist before symlinking it

This commit is contained in:
Aminda Suomalainen 2023-10-06 07:55:06 +03:00
parent 2ac5a8396c
commit 450ff51fa9
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q

View File

@ -4,9 +4,14 @@ set -x
cd ~
mkdir -p ~/.local/bin/
# My pre-commit configuration expects to find a pypy
ln -sf /usr/bin/python ~/.local/bin/pypy
ln -sf /usr/bin/python3 ~/.local/bin/pypy3
if ! hash pypy 2>/dev/null; then
ln -sf /usr/bin/python ~/.local/bin/pypy
fi
if ! hash pypy3 2>/dev/null; then
ln -sf /usr/bin/python3 ~/.local/bin/pypy3
fi
mkdir -p ~/venv
python3 -m venv ~/venv