Created
June 21, 2024 09:22
-
-
Save Luiggi33/9b6bc666b21600ebc6435492787986bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
STASH_NAME="pre-commit-$(date +%s)" | |
git stash save --quiet --keep-index --include-untracked $STASH_NAME | |
exec 1>&2 | |
lint=$(glualint lint .) | |
STASHES=$(git stash list) | |
if echo "$STASHES" | grep -q "$STASH_NAME"; then | |
git stash pop --quiet | |
fi | |
if [ -n "$lint" ]; then | |
cat <<EOF | |
Error: GluaLinter failed | |
You seem to have a glua lint error! | |
Error(s): | |
$lint | |
EOF | |
exit 1 | |
fi | |
exit 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment