@ekkos/cli 1.0.9 → 1.0.10
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/dist/deploy/settings.js +8 -10
- package/package.json +1 -1
package/dist/deploy/settings.js
CHANGED
|
@@ -3,34 +3,32 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deployClaudeSettings = deployClaudeSettings;
|
|
4
4
|
exports.areHooksConfigured = areHooksConfigured;
|
|
5
5
|
const fs_1 = require("fs");
|
|
6
|
+
const path_1 = require("path");
|
|
6
7
|
const platform_1 = require("../utils/platform");
|
|
7
8
|
/**
|
|
8
9
|
* Generate the hooks configuration for Claude Code settings.json
|
|
9
10
|
* Uses the new format required by Claude Code 2.1.40+
|
|
10
11
|
*/
|
|
11
12
|
function generateHooksConfig() {
|
|
12
|
-
// Use
|
|
13
|
-
//
|
|
14
|
-
// on Windows (C:\Users\name/.claude/hooks) which causes "path not found".
|
|
15
|
-
const hooksDir = platform_1.CLAUDE_HOOKS_DIR;
|
|
13
|
+
// Use path.join (via CLAUDE_HOOKS_DIR) so OS-correct separators are used.
|
|
14
|
+
// JSON.stringify handles backslash-escaping automatically — do NOT pre-escape.
|
|
16
15
|
if (platform_1.isWindows) {
|
|
17
|
-
const ps1Dir = hooksDir.replace(/\\/g, '\\\\'); // escape backslashes for JSON string
|
|
18
16
|
return {
|
|
19
17
|
UserPromptSubmit: [
|
|
20
|
-
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${
|
|
18
|
+
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'user-prompt-submit.ps1')}"` }] }
|
|
21
19
|
],
|
|
22
20
|
Stop: [
|
|
23
|
-
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${
|
|
21
|
+
{ hooks: [{ type: 'command', command: `powershell -ExecutionPolicy Bypass -File "${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'stop.ps1')}"` }] }
|
|
24
22
|
],
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
|
-
// Unix
|
|
25
|
+
// Unix: forward slashes, no quoting needed
|
|
28
26
|
return {
|
|
29
27
|
UserPromptSubmit: [
|
|
30
|
-
{ hooks: [{ type: 'command', command: `bash ${
|
|
28
|
+
{ hooks: [{ type: 'command', command: `bash ${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'user-prompt-submit.sh')}` }] }
|
|
31
29
|
],
|
|
32
30
|
Stop: [
|
|
33
|
-
{ hooks: [{ type: 'command', command: `bash ${
|
|
31
|
+
{ hooks: [{ type: 'command', command: `bash ${(0, path_1.join)(platform_1.CLAUDE_HOOKS_DIR, 'stop.sh')}` }] }
|
|
34
32
|
],
|
|
35
33
|
};
|
|
36
34
|
}
|