Skip to content

Commit

Permalink
Update install.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ty-porter authored Feb 28, 2024
1 parent 1d7d5d8 commit 9e563b9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -100,19 +100,21 @@ if [ "$SKIP_VENV" = false ]; then
fi
source ./venv/bin/activate


if ! grep -q "#\!/" main.py; then
if [[ "$OSTYPE" == "darwin"* ]]; then
sed -i '' '1i\'$'\n''#!'"$(which python3)"$'\n' main.py
elif [ "$NO_SUDO" = false ]; then
sed -i "1i #\!/usr/bin/sudo $(which python3)" main.py
sed -i "1i #\!/usr/bin/sudo $(which python3)" main.py
else
sed -i "1i #\!$(which python3)" main.py
sed -i "1i #\!$(which python3)" main.py
fi
chmod +x main.py

if ! grep -q "noshebang" ./.git/config; then
# Add template to .git/config, and trigger the filter by adding the file.
# After that, the shebang should be ignored.
cat .git-config-template >> .git/config
git add main.py
fi
fi
fi
Expand Down

0 comments on commit 9e563b9

Please sign in to comment.