We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0ed0e2b commit 77078a5Copy full SHA for 77078a5
1 file changed
src/vectorcode/subcommands/init.py
@@ -20,11 +20,19 @@
20
__HOOK_CONTENTS: dict[str, list[str]] = {
21
"pre-commit": [
22
"diff_files=$(git diff --cached --name-only)",
23
- '[ -z "$diff_files" ] || vectorcode vectorise $diff_files',
+ 'if [ -d ".vectorcode" ] && [ ! -z "$diff_files" ]; then',
24
+ " vectorcode vectorise $diff_files",
25
+ "fi",
26
],
27
"post-checkout": [
- 'files=$(git diff --name-only "$1" "$2")',
- '[ -z "$files" ] || vectorcode vectorise $files',
28
+ 'if [ -z "$(echo $1|grep [^0])" ]; then',
29
+ ' files=""',
30
+ "else",
31
+ ' files=$(git diff --name-only "$1" "$2")',
32
33
+ 'if [ -d ".vectorcode" ] && [ ! -z "$files" ]; then',
34
+ " vectorcode vectorise $files",
35
36
37
}
38
0 commit comments