use pre-commit hook instead

This commit is contained in:
Dmitriy Pleshevskiy 2022-12-10 23:00:30 +03:00
parent d5bbf88da6
commit 03904d1cd3
Signed by: pleshevskiy
GPG Key ID: 1B59187B161C0215
2 changed files with 7 additions and 3 deletions

View File

@ -15,7 +15,9 @@ build-wasm: build
build:
tree-sitter generate
init:
init: init-tree-sitter init-git-hooks
init-tree-sitter:
if [ ! -f "$(TS_CONF)" ]; then \
tree-sitter init-config; \
fi
@ -24,3 +26,5 @@ init:
cat <<< $$(jq ".\"parser-directories\" |= . + [\"$$(dirname $(PWD))\"]" $(TS_CONF)) > $(TS_CONF); \
fi
init-git-hooks:
ln -s $(PWD)/scripts/pre-commit $(PWD)/.git/hooks/pre-commit

View File

@ -1,7 +1,7 @@
#! /usr/bin/env bash
# Can be used as a pre-push hook
# Just symlink this file to .git/hooks/pre-push
# Can be used as a pre-commit hook
# Just symlink this file to .git/hooks/pre-commit
set -xe