use pre-commit hook instead
This commit is contained in:
parent
d5bbf88da6
commit
03904d1cd3
2 changed files with 7 additions and 3 deletions
6
Makefile
6
Makefile
|
@ -15,7 +15,9 @@ build-wasm: build
|
||||||
build:
|
build:
|
||||||
tree-sitter generate
|
tree-sitter generate
|
||||||
|
|
||||||
init:
|
init: init-tree-sitter init-git-hooks
|
||||||
|
|
||||||
|
init-tree-sitter:
|
||||||
if [ ! -f "$(TS_CONF)" ]; then \
|
if [ ! -f "$(TS_CONF)" ]; then \
|
||||||
tree-sitter init-config; \
|
tree-sitter init-config; \
|
||||||
fi
|
fi
|
||||||
|
@ -24,3 +26,5 @@ init:
|
||||||
cat <<< $$(jq ".\"parser-directories\" |= . + [\"$$(dirname $(PWD))\"]" $(TS_CONF)) > $(TS_CONF); \
|
cat <<< $$(jq ".\"parser-directories\" |= . + [\"$$(dirname $(PWD))\"]" $(TS_CONF)) > $(TS_CONF); \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
init-git-hooks:
|
||||||
|
ln -s $(PWD)/scripts/pre-commit $(PWD)/.git/hooks/pre-commit
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#! /usr/bin/env bash
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
# Can be used as a pre-push hook
|
# Can be used as a pre-commit hook
|
||||||
# Just symlink this file to .git/hooks/pre-push
|
# Just symlink this file to .git/hooks/pre-commit
|
||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
Loading…
Reference in a new issue