licenseguard-cli 2.3.0 → 2.3.1
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/.claude/settings.local.json +7 -0
- package/lib/postinstall.js +4 -18
- package/package.json +1 -1
package/lib/postinstall.js
CHANGED
|
@@ -117,24 +117,10 @@ function setupGlobalHooks() {
|
|
|
117
117
|
return
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
//
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'))
|
|
125
|
-
isEsm = pkg.type === 'module'
|
|
126
|
-
}
|
|
127
|
-
} catch (e) {
|
|
128
|
-
// ignore
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const postCheckoutHook = isEsm
|
|
132
|
-
? generatePostCheckoutHookEsm()
|
|
133
|
-
: generatePostCheckoutHookCjs()
|
|
134
|
-
|
|
135
|
-
const preCommitHook = isEsm
|
|
136
|
-
? generatePreCommitHookEsm()
|
|
137
|
-
: generatePreCommitHookCjs()
|
|
120
|
+
// Always use ESM for global hooks - ESM works in both ESM and CJS projects
|
|
121
|
+
// CJS hooks fail in ESM projects, but ESM hooks work everywhere
|
|
122
|
+
const postCheckoutHook = generatePostCheckoutHookEsm()
|
|
123
|
+
const preCommitHook = generatePreCommitHookEsm()
|
|
138
124
|
|
|
139
125
|
// Create template directories
|
|
140
126
|
if (!fs.existsSync(hooksDir)) {
|