codepet 1.0.2 → 1.0.3

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 +3 -2
  2. package/package.json +1 -1
package/bin/codepet.js CHANGED
@@ -350,9 +350,10 @@ function doCard() {
350
350
  if (fs.existsSync(cardScript)) {
351
351
  try {
352
352
  execSync(`${PYTHON} "${cardScript}"`, { encoding: 'utf-8', stdio: 'inherit' });
353
- // 确保弹出 Preview
353
+ // 跨平台打开图片
354
354
  const cardPath = path.join(os.homedir(), '.codepet', 'card.png');
355
- execSync(`open "${cardPath}"`, { stdio: 'ignore' });
355
+ const openCmd = process.platform === 'win32' ? 'start ""' : process.platform === 'darwin' ? 'open' : 'xdg-open';
356
+ execSync(`${openCmd} "${cardPath}"`, { stdio: 'ignore', shell: true });
356
357
  } catch (e) {
357
358
  console.log(' 卡片生成失败。');
358
359
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codepet",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "在编程软件里养电子宠物 — 支持 Claude Code / Codex / Cursor / VS Code 等 10+ 平台",
5
5
  "main": "core/index.js",
6
6
  "bin": {