codepet 1.0.22 → 1.0.23
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 +7 -2
- package/package.json +1 -1
package/bin/codepet.js
CHANGED
|
@@ -487,8 +487,13 @@ function doPopup() {
|
|
|
487
487
|
} else if (process.platform === 'win32') {
|
|
488
488
|
// Windows: 弹新 PowerShell 窗口,自动开启 ANSI 彩色支持
|
|
489
489
|
const script = path.join(__dirname, '..', 'scripts', 'polaroid.py').replace(/\\/g, '/');
|
|
490
|
-
// Windows:
|
|
491
|
-
|
|
490
|
+
// Windows: 用 Node.js spawn 弹新 CMD 窗口(不依赖 shell 环境)
|
|
491
|
+
const { spawn } = require('child_process');
|
|
492
|
+
spawn('cmd', ['/c', 'start', 'cmd', '/k', PYTHON, script, pet.character, scene, '40'], {
|
|
493
|
+
detached: true,
|
|
494
|
+
stdio: 'ignore',
|
|
495
|
+
shell: false,
|
|
496
|
+
}).unref();
|
|
492
497
|
} else {
|
|
493
498
|
// Linux: 尝试终端弹窗
|
|
494
499
|
const script = path.join(__dirname, '..', 'scripts', 'polaroid.py');
|