From c9b10f09e27b2bd3791d2aa24d5e387313a2bb4b Mon Sep 17 00:00:00 2001 From: Brian Ward Date: Fri, 16 Feb 2024 22:48:42 -0500 Subject: [PATCH] Extra git magic to skip the shebang line in main --- .git-config-template | 4 ++++ .gitattributes | 1 + install.sh | 4 ++++ 3 files changed, 9 insertions(+) create mode 100644 .git-config-template create mode 100644 .gitattributes diff --git a/.git-config-template b/.git-config-template new file mode 100644 index 00000000..46177aec --- /dev/null +++ b/.git-config-template @@ -0,0 +1,4 @@ +[filter "noshebang"] + clean = grep -v '.!/.*python3' + smudge = cat + required diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..eac12b97 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +main.py filter=noshebang diff --git a/install.sh b/install.sh index 12e2e8e4..98d9ec5f 100755 --- a/install.sh +++ b/install.sh @@ -108,6 +108,10 @@ if [ "$SKIP_VENV" = false ]; then sed -i "1i #\!$(which python3)" main.py fi chmod +x main.py + + if ! grep -q "noshebang" ./.git/config; then + cat .git-config-template >> .git/config + fi fi fi PYTHON=$(which python3)