Skip to content

Commit 44ec62a

Browse files
committed
Add pre-commit hook script to manage pre-commit tasks
1 parent aaff730 commit 44ec62a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

.husky/_/pre-commit

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/sh
2+
3+
if [ "$SKIP_SIMPLE_GIT_HOOKS" = "1" ]; then
4+
echo "[INFO] SKIP_SIMPLE_GIT_HOOKS is set to 1, skipping hook."
5+
exit 0
6+
fi
7+
8+
if [ -f "$SIMPLE_GIT_HOOKS_RC" ]; then
9+
. "$SIMPLE_GIT_HOOKS_RC"
10+
fi
11+
12+
npm run pre-commit-hook

scripts/prepare-publish.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,7 @@ const main = async () => {
8080

8181
main().catch((error) => {
8282
console.error("Failed to prepare dist package:", error);
83-
process.exitCode = 1;
83+
if (globalThis.process) {
84+
globalThis.process.exitCode = 1;
85+
}
8486
});

0 commit comments

Comments
 (0)