codewhale.history 2.8.4 → 2.8.5

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/package.json +1 -1
  2. package/tools-install.js +3 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codewhale.history",
3
- "version": "2.8.4",
3
+ "version": "2.8.5",
4
4
  "description": "CodeWhale utility commands: session history, tool listing, file snapshot, interactive code quiz — global install",
5
5
  "bin": {
6
6
  "codewhale-history": "./_list_sessions.js",
package/tools-install.js CHANGED
@@ -18,7 +18,9 @@ const sourceDir = __dirname;
18
18
  // Parse -p flag
19
19
  const pIndex = process.argv.indexOf('-p');
20
20
  const workspaceArg = pIndex !== -1 ? process.argv[pIndex + 1] : null;
21
- const workspacePath = path.resolve(workspaceArg || process.cwd());
21
+ // When run via npm postinstall, process.cwd() is the package dir.
22
+ // INIT_CWD points to the project root where the user ran `npm install`.
23
+ const workspacePath = path.resolve(workspaceArg || process.env.INIT_CWD || process.cwd());
22
24
 
23
25
  // ── 1. Install skills ──────────────────────────────────
24
26
  const skillsSource = path.join(sourceDir, 'skills');