skalpel 4.0.4 → 4.0.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.
- package/install.mjs +9 -4
- package/package.json +1 -1
package/install.mjs
CHANGED
|
@@ -67,14 +67,17 @@ if (!uninstall && !process.env.SKALPEL_HOOK_BIN) {
|
|
|
67
67
|
|
|
68
68
|
// The wired command. Defaults to the staged absolute `node <path>`; SKALPEL_HOOK_BIN /
|
|
69
69
|
// SKALPEL_HOOK_SESSION_BIN still override (dev, or a deliberate global-bin install).
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
// QUOTE the path: on Windows the staged path is `C:\Users\First Last\.skalpel\hooks\…`, and an
|
|
71
|
+
// UNQUOTED `node <path>` splits at the space so node gets `C:\Users\First` → ERR_MODULE_NOT_FOUND
|
|
72
|
+
// (the esm/resolve crash on every hook). Double-quotes are safe on Windows cmd/PowerShell AND POSIX.
|
|
73
|
+
const CMD = process.env.SKALPEL_HOOK_BIN || `node "${HOOK_FILE}"`;
|
|
74
|
+
const SESSION_CMD = process.env.SKALPEL_HOOK_SESSION_BIN || `node "${SESSION_FILE}"`;
|
|
72
75
|
const sessionEndRuntime =
|
|
73
76
|
process.env.SKALPEL_HOOK_BIN && PKG_DIR !== HOOKS_DIR
|
|
74
77
|
? join(PKG_DIR, "skalpel-hook-session-end.mjs")
|
|
75
78
|
: SESSION_END_FILE;
|
|
76
|
-
const SESSION_END_CMD = process.env.SKALPEL_HOOK_SESSION_END_BIN || `node ${sessionEndRuntime}`;
|
|
77
|
-
const STATUSLINE_CMD = process.env.SKALPEL_STATUSLINE_BIN || `node ${STATUSLINE_FILE}`;
|
|
79
|
+
const SESSION_END_CMD = process.env.SKALPEL_HOOK_SESSION_END_BIN || `node "${sessionEndRuntime}"`;
|
|
80
|
+
const STATUSLINE_CMD = process.env.SKALPEL_STATUSLINE_BIN || `node "${STATUSLINE_FILE}"`;
|
|
78
81
|
const CLAUDE = join(homedir(), ".claude", "settings.json");
|
|
79
82
|
const CODEX_DIR = join(homedir(), ".codex");
|
|
80
83
|
const CODEX = join(CODEX_DIR, "hooks.json");
|
|
@@ -83,6 +86,8 @@ const CODEX_TOML = join(CODEX_DIR, "config.toml"); // Codex reads hooks from con
|
|
|
83
86
|
// installer wired, including bare-bin names and absolute `node <path>` commands.
|
|
84
87
|
const markerOf = (cmd) =>
|
|
85
88
|
cmd
|
|
89
|
+
.replace(/"/g, "") // tolerate the quoted `node "<path>"` form (Windows-safe) — strip quotes first
|
|
90
|
+
.trim()
|
|
86
91
|
.split(/[/\\]/)
|
|
87
92
|
.pop()
|
|
88
93
|
.replace(/\.(mjs|js|exe)$/, "");
|