codepet 1.0.18 → 1.0.19

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.
Files changed (2) hide show
  1. package/bin/codepet.js +4 -2
  2. package/package.json +1 -1
package/bin/codepet.js CHANGED
@@ -16,9 +16,11 @@ const { execSync } = require('child_process');
16
16
 
17
17
  // 跨平台 Python 命令检测
18
18
  function getPython() {
19
- for (const cmd of ['python3', 'python']) {
19
+ // Windows 优先 python,Mac/Linux 优先 python3
20
+ const order = process.platform === 'win32' ? ['python', 'python3'] : ['python3', 'python'];
21
+ for (const cmd of order) {
20
22
  try {
21
- execSync(`${cmd} --version`, { stdio: 'ignore' });
23
+ execSync(`${cmd} -c "print(1)"`, { stdio: 'ignore' });
22
24
  return cmd;
23
25
  } catch {}
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codepet",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "在编程软件里养电子宠物 — 支持 Claude Code / Codex / Cursor / VS Code 等 10+ 平台",
5
5
  "main": "core/index.js",
6
6
  "bin": {