cc-pets 1.0.0 → 1.0.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/Sources/CCPets/main.m
CHANGED
|
@@ -1651,6 +1651,13 @@ static int RenderMenuSwitches(NSString *path) {
|
|
|
1651
1651
|
@"--allow-scripts=cc-pets",
|
|
1652
1652
|
@"--prefer-online"
|
|
1653
1653
|
];
|
|
1654
|
+
NSMutableDictionary<NSString *, NSString *> *environment =
|
|
1655
|
+
[NSProcessInfo.processInfo.environment mutableCopy];
|
|
1656
|
+
NSString *nodeDirectory = nodePath.stringByDeletingLastPathComponent;
|
|
1657
|
+
NSString *existingPath = environment[@"PATH"];
|
|
1658
|
+
if (existingPath.length == 0) existingPath = @"/usr/bin:/bin:/usr/sbin:/sbin";
|
|
1659
|
+
environment[@"PATH"] = [NSString stringWithFormat:@"%@:%@", nodeDirectory, existingPath];
|
|
1660
|
+
task.environment = environment;
|
|
1654
1661
|
task.currentDirectoryURL = [NSURL fileURLWithPath:NSHomeDirectory()];
|
|
1655
1662
|
task.standardOutput = logHandle;
|
|
1656
1663
|
task.standardError = logHandle;
|
package/package.json
CHANGED
|
@@ -11,14 +11,24 @@ END_MARKER="# <<< cc-pets-codex <<<"
|
|
|
11
11
|
CLAUDE_START_MARKER="# >>> cc-pets-claude >>>"
|
|
12
12
|
CLAUDE_END_MARKER="# <<< cc-pets-claude <<<"
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
NODE_EXECUTABLE="${npm_node_execpath:-}"
|
|
15
|
+
if [[ -z "${NODE_EXECUTABLE}" || ! -x "${NODE_EXECUTABLE}" ]]; then
|
|
16
|
+
NODE_EXECUTABLE="$(command -v node || true)"
|
|
17
|
+
fi
|
|
18
|
+
if [[ -z "${NODE_EXECUTABLE}" || ! -x "${NODE_EXECUTABLE}" ]]; then
|
|
19
|
+
print -u2 "安装失败:找不到可执行的 Node.js。"
|
|
20
|
+
exit 1
|
|
21
|
+
fi
|
|
22
|
+
export PATH="${NODE_EXECUTABLE:h}:${PATH:-/usr/bin:/bin:/usr/sbin:/sbin}"
|
|
23
|
+
|
|
24
|
+
"${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/uninstall-integrations.mjs" --prepare-install "${SHELL_RC}"
|
|
15
25
|
"${PROJECT_DIR}/scripts/build.sh"
|
|
16
26
|
"${PROJECT_DIR}/scripts/install-app.sh"
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
"${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/install-codex-hooks.mjs" "${PROJECT_DIR}/.build/release/cc-pets"
|
|
28
|
+
"${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/install-claude-hooks.mjs" \
|
|
19
29
|
"${PROJECT_DIR}/.build/release/cc-pets" \
|
|
20
30
|
"${PROJECT_DIR}/bin/claude-statusline-with-pet"
|
|
21
|
-
|
|
31
|
+
"${NODE_EXECUTABLE}" "${PROJECT_DIR}/scripts/configure-updater.mjs"
|
|
22
32
|
|
|
23
33
|
PET_APP="${PROJECT_DIR}/.build/release/CC Pets.app"
|
|
24
34
|
PET_APP_EXECUTABLE="${PET_APP}/Contents/MacOS/cc-pets"
|