claude-dev-env 1.2.0 → 1.2.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.
package/bin/install.mjs
CHANGED
|
@@ -81,13 +81,14 @@ function mergeHooks(pythonCommand) {
|
|
|
81
81
|
}
|
|
82
82
|
if (!settings.hooks) settings.hooks = {};
|
|
83
83
|
const installedHooksDir = join(CLAUDE_HOME, 'hooks');
|
|
84
|
+
const pluginRootDir = CLAUDE_HOME;
|
|
84
85
|
let groupCount = 0;
|
|
85
86
|
for (const [eventType, matcherGroups] of Object.entries(hooksConfig.hooks)) {
|
|
86
87
|
if (!settings.hooks[eventType]) settings.hooks[eventType] = [];
|
|
87
88
|
for (const sourceGroup of matcherGroups) {
|
|
88
89
|
const rewrittenHooks = sourceGroup.hooks.map(hook => {
|
|
89
90
|
let command = hook.command;
|
|
90
|
-
command = command.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g,
|
|
91
|
+
command = command.replace(/\$\{CLAUDE_PLUGIN_ROOT\}/g, pluginRootDir.replace(/\\/g, '/'));
|
|
91
92
|
command = command.replace(/^python3\b/, pythonCommand);
|
|
92
93
|
return { ...hook, command };
|
|
93
94
|
});
|
|
@@ -40,6 +40,7 @@ def get_question_from_stdin() -> str:
|
|
|
40
40
|
|
|
41
41
|
def main() -> None:
|
|
42
42
|
system = platform.system()
|
|
43
|
+
wsl_mode = is_wsl()
|
|
43
44
|
|
|
44
45
|
project_name = get_project_name()
|
|
45
46
|
question_text = get_question_from_stdin()
|
|
@@ -49,7 +50,7 @@ def main() -> None:
|
|
|
49
50
|
if system == "Windows":
|
|
50
51
|
sound_windows()
|
|
51
52
|
notify_windows(project_name, question_text)
|
|
52
|
-
elif
|
|
53
|
+
elif wsl_mode:
|
|
53
54
|
sound_wsl()
|
|
54
55
|
notify_wsl(project_name, question_text)
|
|
55
56
|
elif system == "Linux":
|
|
@@ -156,15 +156,18 @@ def notify_ntfy(title: str, message: str, priority: str = "high") -> None:
|
|
|
156
156
|
|
|
157
157
|
|
|
158
158
|
def notify_linux() -> None:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
159
|
+
try:
|
|
160
|
+
subprocess.Popen(
|
|
161
|
+
[
|
|
162
|
+
"notify-send", "-t", LINUX_NOTIFICATION_TIMEOUT_MS,
|
|
163
|
+
"-u", "normal", "-i", "dialog-warning",
|
|
164
|
+
DEFAULT_LINUX_TOAST_TITLE, DEFAULT_LINUX_TOAST_MESSAGE,
|
|
165
|
+
],
|
|
166
|
+
stdout=subprocess.DEVNULL,
|
|
167
|
+
stderr=subprocess.DEVNULL
|
|
168
|
+
)
|
|
169
|
+
except FileNotFoundError:
|
|
170
|
+
return
|
|
168
171
|
|
|
169
172
|
|
|
170
173
|
def sound_windows() -> None:
|