@simonyea/holysheep-cli 1.7.82 → 1.7.84
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/package.json +1 -1
- package/src/utils/shell.js +1 -0
- package/src/webui/server.js +8 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.84",
|
|
4
4
|
"description": "Claude Code/Cursor/Cline API relay for China — ¥1=$1, WeChat/Alipay payment, no credit card, no VPN. One command setup for all AI coding tools.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openai-china",
|
package/src/utils/shell.js
CHANGED
|
@@ -213,6 +213,7 @@ function removeWindowsUserEnvVars(keys = []) {
|
|
|
213
213
|
`powershell.exe -NoProfile -Command "[Environment]::SetEnvironmentVariable('${key}', $null, 'User')"`,
|
|
214
214
|
{ stdio: 'ignore' }
|
|
215
215
|
)
|
|
216
|
+
delete process.env[key]
|
|
216
217
|
removed.push(`[系统环境变量] ${key}`)
|
|
217
218
|
} catch {}
|
|
218
219
|
}
|
package/src/webui/server.js
CHANGED
|
@@ -594,12 +594,18 @@ async function handleToolUpgrade(req, res) {
|
|
|
594
594
|
|
|
595
595
|
sseEmit(res, { type: 'progress', message: `正在升级 ${entry.name}...` })
|
|
596
596
|
|
|
597
|
+
const UPGRADE_TIMEOUT_MS = 10 * 60 * 1000 // 10 分钟
|
|
597
598
|
const ok = await new Promise(resolve => {
|
|
598
599
|
const child = spawn(entry.installCmd, [], { shell: true })
|
|
600
|
+
const timer = setTimeout(() => {
|
|
601
|
+
sseEmit(res, { type: 'progress', message: `⚠️ 升级超时(10分钟),请手动运行: ${entry.installCmd}` })
|
|
602
|
+
try { child.kill('SIGKILL') } catch {}
|
|
603
|
+
resolve(false)
|
|
604
|
+
}, UPGRADE_TIMEOUT_MS)
|
|
599
605
|
child.stdout?.on('data', chunk => sseEmit(res, { type: 'output', text: chunk.toString() }))
|
|
600
606
|
child.stderr?.on('data', chunk => sseEmit(res, { type: 'output', text: chunk.toString() }))
|
|
601
|
-
child.on('close', code => resolve(code === 0))
|
|
602
|
-
child.on('error', () => resolve(false))
|
|
607
|
+
child.on('close', code => { clearTimeout(timer); resolve(code === 0) })
|
|
608
|
+
child.on('error', () => { clearTimeout(timer); resolve(false) })
|
|
603
609
|
})
|
|
604
610
|
|
|
605
611
|
let newVer = null
|