Skip to content

Commit

Permalink
Extra git magic to skip the shebang line in main
Browse files Browse the repository at this point in the history
  • Loading branch information
WardBrian committed Feb 17, 2024
1 parent b75fb4a commit c9b10f0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .git-config-template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[filter "noshebang"]
clean = grep -v '.!/.*python3'
smudge = cat
required
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main.py filter=noshebang
4 changes: 4 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit c9b10f0

Please sign in to comment.