@solongate/proxy 0.80.0 → 0.81.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.
@@ -252,12 +252,14 @@ async function runGlobalInstall(opts = {}) {
252
252
  const auditAbs = join(p.hooksDir, "audit.mjs").replace(/\\/g, "/");
253
253
  const stopAbs = join(p.hooksDir, "stop.mjs").replace(/\\/g, "/");
254
254
  const nodeBin = process.execPath.replace(/\\/g, "/");
255
+ const call = process.platform === "win32" ? "& " : "";
256
+ const hookCmd = (script) => `${call}"${nodeBin}" "${script}" claude-code "Claude Code"`;
255
257
  const merged = {
256
258
  ...existing,
257
259
  hooks: {
258
- PreToolUse: [{ matcher: "", hooks: [{ type: "command", command: `"${nodeBin}" "${guardAbs}" claude-code "Claude Code"` }] }],
259
- PostToolUse: [{ matcher: "", hooks: [{ type: "command", command: `"${nodeBin}" "${auditAbs}" claude-code "Claude Code"` }] }],
260
- Stop: [{ matcher: "", hooks: [{ type: "command", command: `"${nodeBin}" "${stopAbs}" claude-code "Claude Code"` }] }]
260
+ PreToolUse: [{ matcher: "", hooks: [{ type: "command", command: hookCmd(guardAbs) }] }],
261
+ PostToolUse: [{ matcher: "", hooks: [{ type: "command", command: hookCmd(auditAbs) }] }],
262
+ Stop: [{ matcher: "", hooks: [{ type: "command", command: hookCmd(stopAbs) }] }]
261
263
  }
262
264
  };
263
265
  writeFileSync(p.settingsPath, JSON.stringify(merged, null, 2) + "\n");