steamos-venv-pre-commit.bash: install pipx and pre-commit within it instead

This commit is contained in:
Aminda Suomalainen 2023-10-16 19:49:20 +03:00
parent fccdceda63
commit 027fc0329c
Signed by: Mikaela
SSH Key Fingerprint: SHA256:CXLULpqNBdUKB6E6fLA1b/4SzG0HvKD19PbIePU175Q

View File

@ -17,7 +17,10 @@ mkdir -p ~/venv
python3 -m venv ~/venv python3 -m venv ~/venv
. ~/venv/bin/activate . ~/venv/bin/activate
python3 -m pip install pip --upgrade python3 -m pip install pip --upgrade
python3 -m pip install pre-commit --upgrade python3 -m pip install pipx --upgrade
python3 -m pipx install pre-commit
python3 -m pipx upgrade-all
# Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896 # Removes duplicates from $PATH. Copied from https://unix.stackexchange.com/a/14896
PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}') PATH=$(echo "$PATH" | awk -v RS=':' -v ORS=":" '!a[$1]++{if (NR > 1) printf ORS; printf $a[$1]}')
printf "Remember to apply the following somewhere appropiate:\nPATH=$PATH" printf "Remember to apply the following somewhere appropiate:\nPATH=$PATH"