mirror of
https://gitea.blesmrt.net/mikaela/scripts.git
synced 2025-01-22 02:04:09 +01:00
steamos-venv-pre-commit.bash: more comments and pre-commit init-templatedir
This commit is contained in:
parent
027fc0329c
commit
627f865be7
@ -1,5 +1,7 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
# This is a noteish on how to pre-commit on SteamOS
|
# This is a noteish on how to pre-commit on SteamOS. Or it was, but then I
|
||||||
|
# decided that pipx is a thing that I could put into the venv more reasonably
|
||||||
|
# and feel less bad about abusing it O:)
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
cd ~
|
cd ~
|
||||||
@ -21,6 +23,12 @@ python3 -m pip install pipx --upgrade
|
|||||||
python3 -m pipx install pre-commit
|
python3 -m pipx install pre-commit
|
||||||
python3 -m pipx upgrade-all
|
python3 -m pipx upgrade-all
|
||||||
|
|
||||||
|
# As this script claims to be pre-commit on SteamOS, let's do it properly all
|
||||||
|
# the way!
|
||||||
|
mkdir -p ~/.git-template
|
||||||
|
git config --global init.templatedir ~/.git-template
|
||||||
|
pre-commit init-templatedir ~/.git-template
|
||||||
|
|
||||||
# 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"
|
||||||
|
Loading…
Reference in New Issue
Block a user