codepet 1.0.5 → 1.0.7
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/codepet.js +6 -9
- package/package.json +12 -2
package/bin/codepet.js
CHANGED
|
@@ -476,20 +476,17 @@ function doPopup() {
|
|
|
476
476
|
if (!pet) { console.log(' 还没有宠物。'); return; }
|
|
477
477
|
if (!PYTHON) { console.log(' 需要安装 Python。'); return; }
|
|
478
478
|
const scene = arg || 'normal';
|
|
479
|
-
const script = path.join(__dirname, '..', 'scripts', 'polaroid.py');
|
|
480
479
|
|
|
481
|
-
if (process.platform === '
|
|
482
|
-
//
|
|
483
|
-
|
|
484
|
-
execSync(`start "" cmd /k "${PYTHON} \\"${script}\\" ${pet.character} ${scene} 40 2>nul"`, { shell: true, stdio: 'ignore' });
|
|
485
|
-
} else if (process.platform === 'darwin') {
|
|
486
|
-
// macOS: 用 osascript 弹 Terminal
|
|
480
|
+
if (process.platform === 'darwin') {
|
|
481
|
+
// macOS: 弹新 Terminal 窗口显示彩色像素风拍立得
|
|
482
|
+
const script = path.join(__dirname, '..', 'scripts', 'polaroid.py');
|
|
487
483
|
const escapedScript = script.replace(/'/g, "'\\''");
|
|
488
484
|
execSync(`osascript -e 'tell application "Terminal" to do script "export HISTFILE=/dev/null && export BASH_SILENCE_DEPRECATION_WARNING=1 && export PS1=\\\"\\\" && clear && ${PYTHON} \\\"${escapedScript}\\\" ${pet.character} ${scene} 40 2>/dev/null && printf \\\"\\\\033[?25l\\\" && cat > /dev/null"' -e 'tell application "Terminal" to activate' &`, { shell: true, stdio: 'ignore' });
|
|
489
485
|
} else {
|
|
490
|
-
// Linux
|
|
486
|
+
// Windows / Linux: 生成 PNG 拍立得图片,用系统图片查看器打开
|
|
487
|
+
const script = path.join(__dirname, '..', 'scripts', 'polaroid_image.py');
|
|
491
488
|
try {
|
|
492
|
-
execSync(`${PYTHON} "${script}" ${pet.character} ${scene}
|
|
489
|
+
execSync(`${PYTHON} "${script}" ${pet.character} ${scene}`, { encoding: 'utf-8', stdio: 'inherit' });
|
|
493
490
|
} catch {}
|
|
494
491
|
}
|
|
495
492
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codepet",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.7",
|
|
4
4
|
"description": "在编程软件里养电子宠物 — 支持 Claude Code / Codex / Cursor / VS Code 等 10+ 平台",
|
|
5
5
|
"main": "core/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -13,15 +13,25 @@
|
|
|
13
13
|
},
|
|
14
14
|
"keywords": [
|
|
15
15
|
"pet",
|
|
16
|
+
"codepet",
|
|
17
|
+
"宠物",
|
|
18
|
+
"chongwu",
|
|
16
19
|
"coding-companion",
|
|
17
20
|
"terminal-art",
|
|
18
21
|
"claude-code",
|
|
19
22
|
"vscode",
|
|
20
23
|
"cursor",
|
|
21
24
|
"codex",
|
|
25
|
+
"kiro",
|
|
26
|
+
"codebuddy",
|
|
27
|
+
"openclaw",
|
|
28
|
+
"antigravity",
|
|
29
|
+
"opencode",
|
|
22
30
|
"ascii-art",
|
|
23
31
|
"pixel-art",
|
|
24
|
-
"tamagotchi"
|
|
32
|
+
"tamagotchi",
|
|
33
|
+
"ai-pet",
|
|
34
|
+
"ai小蓝鲸"
|
|
25
35
|
],
|
|
26
36
|
"author": "Ai小蓝鲸",
|
|
27
37
|
"license": "MIT",
|