@simplysm/claude 13.0.0-beta.23 → 13.0.0-beta.24
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/package.json +1 -1
- package/scripts/postinstall.mjs +12 -3
package/package.json
CHANGED
package/scripts/postinstall.mjs
CHANGED
|
@@ -11,10 +11,19 @@ try {
|
|
|
11
11
|
const pkgRoot = path.resolve(__dirname, "..");
|
|
12
12
|
const sourceDir = path.join(pkgRoot, "claude");
|
|
13
13
|
|
|
14
|
-
// INIT_CWD:
|
|
15
|
-
|
|
14
|
+
// INIT_CWD: npm/yarn이 설정하는 프로젝트 루트 경로
|
|
15
|
+
// pnpm은 INIT_CWD를 설정하지 않으므로 (https://github.com/pnpm/pnpm/issues/7042)
|
|
16
|
+
// 스크립트 경로에서 첫 번째 node_modules 이전 경로를 프로젝트 루트로 사용
|
|
17
|
+
const projectRoot =
|
|
18
|
+
process.env.INIT_CWD ||
|
|
19
|
+
(() => {
|
|
20
|
+
const sep = path.sep;
|
|
21
|
+
const marker = sep + "node_modules" + sep;
|
|
22
|
+
const idx = __dirname.indexOf(marker);
|
|
23
|
+
return idx !== -1 ? __dirname.substring(0, idx) : null;
|
|
24
|
+
})();
|
|
16
25
|
if (!projectRoot) {
|
|
17
|
-
console.log("[
|
|
26
|
+
console.log("[@simplysm/claude] 프로젝트 루트를 찾을 수 없어 건너뜁니다.");
|
|
18
27
|
process.exit(0);
|
|
19
28
|
}
|
|
20
29
|
|