codepet 1.0.19 → 1.0.21
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 +2 -5
- package/package.json +1 -1
package/bin/codepet.js
CHANGED
|
@@ -487,11 +487,8 @@ 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
|
-
//
|
|
491
|
-
|
|
492
|
-
const batContent = `@echo off\r\ntitle 📸 Ai小蓝鲸照相馆\r\n${PYTHON} "${script}" ${pet.character} ${scene} 40\r\nif errorlevel 1 (echo. & echo 出错了,请确认已安装 Pillow: pip install Pillow wcwidth)\r\npause >nul\r\n`;
|
|
493
|
-
fs.writeFileSync(tmpBat, batContent, 'utf-8');
|
|
494
|
-
execSync(`start "" "${tmpBat}"`, { shell: true, stdio: 'ignore' });
|
|
490
|
+
// Windows: cmd /c "start cmd /k ..." 是最可靠的弹窗方式
|
|
491
|
+
execSync(`cmd /c "start cmd /k ${PYTHON} ${script} ${pet.character} ${scene} 40"`, { shell: true, stdio: 'ignore' });
|
|
495
492
|
} else {
|
|
496
493
|
// Linux: 尝试终端弹窗
|
|
497
494
|
const script = path.join(__dirname, '..', 'scripts', 'polaroid.py');
|