@rachel_rotenberg/ai-contribution-tracker 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.js +9 -1
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -63,7 +63,15 @@ function appendOrCreateHook(hooksDir) {
|
|
|
63
63
|
fs.appendFileSync(hookPath, "\n" + HOOK_BODY + "\n");
|
|
64
64
|
ok(`Appended AI tracker snippet to existing hook: ${hookPath}`);
|
|
65
65
|
} else {
|
|
66
|
-
const
|
|
66
|
+
const delegation = [
|
|
67
|
+
"#!/bin/sh",
|
|
68
|
+
'LOCAL_HOOK="$(git rev-parse --git-dir)/hooks/commit-msg"',
|
|
69
|
+
'if [ -f "$LOCAL_HOOK" ] && [ -x "$LOCAL_HOOK" ]; then',
|
|
70
|
+
' "$LOCAL_HOOK" "$@" || exit $?',
|
|
71
|
+
'fi',
|
|
72
|
+
"",
|
|
73
|
+
].join("\n");
|
|
74
|
+
const content = (delegation + HOOK_BODY + "\n").replace(/\r\n/g, "\n");
|
|
67
75
|
fs.writeFileSync(hookPath, content);
|
|
68
76
|
ok(`Created commit-msg hook: ${hookPath}`);
|
|
69
77
|
}
|
package/package.json
CHANGED