@simonyea/holysheep-cli 1.7.77 → 1.7.78

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@simonyea/holysheep-cli",
3
- "version": "1.7.77",
3
+ "version": "1.7.78",
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",
@@ -768,7 +768,14 @@ function startServer(port) {
768
768
  if (err.code === 'EADDRINUSE') {
769
769
  // Try to kill stale process and retry once
770
770
  try {
771
- execSync(`lsof -ti:${port} | xargs kill -9`, { stdio: 'ignore' })
771
+ if (process.platform === 'win32') {
772
+ // Windows: find PID by port and kill
773
+ const out = execSync(`netstat -ano | findstr :${port} | findstr LISTENING`, { stdio: 'pipe', encoding: 'utf8', shell: true })
774
+ const pids = [...new Set(out.match(/\d+\s*$/gm)?.map(s => s.trim()).filter(Boolean) || [])]
775
+ for (const pid of pids) { try { execSync(`taskkill /F /PID ${pid}`, { stdio: 'ignore' }) } catch {} }
776
+ } else {
777
+ execSync(`lsof -ti:${port} | xargs kill -9`, { stdio: 'ignore' })
778
+ }
772
779
  } catch {}
773
780
  setTimeout(() => {
774
781
  const retry = http.createServer(handleRequest)