Skip to content

Instantly share code, notes, and snippets.

@Luiggi33
Created June 21, 2024 09:22
Show Gist options
  • Save Luiggi33/9b6bc666b21600ebc6435492787986bc to your computer and use it in GitHub Desktop.
Save Luiggi33/9b6bc666b21600ebc6435492787986bc to your computer and use it in GitHub Desktop.
#!/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