@simonyea/holysheep-cli 1.7.35 → 1.7.36

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.35",
3
+ "version": "1.7.36",
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",
@@ -72,7 +72,36 @@ function waitPortFree(port, maxTries, intervalMs) {
72
72
  return openclawTool.getPortListeners(port).length === 0
73
73
  }
74
74
 
75
+ function findChrome() {
76
+ const { existsSync } = require('fs')
77
+ if (process.platform === 'darwin') {
78
+ const p = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'
79
+ return existsSync(p) ? p : null
80
+ }
81
+ if (isWin) {
82
+ const candidates = [
83
+ process.env.LOCALAPPDATA && `${process.env.LOCALAPPDATA}\\Google\\Chrome\\Application\\chrome.exe`,
84
+ process.env.PROGRAMFILES && `${process.env.PROGRAMFILES}\\Google\\Chrome\\Application\\chrome.exe`,
85
+ process.env['PROGRAMFILES(X86)'] && `${process.env['PROGRAMFILES(X86)']}\\Google\\Chrome\\Application\\chrome.exe`,
86
+ ].filter(Boolean)
87
+ return candidates.find(existsSync) || null
88
+ }
89
+ for (const bin of ['google-chrome', 'chromium-browser', 'chromium']) {
90
+ try { execSync(`which ${bin}`, { stdio: 'ignore' }); return bin } catch {}
91
+ }
92
+ return null
93
+ }
94
+
75
95
  function openBrowser(url) {
96
+ const chrome = findChrome()
97
+ if (chrome) {
98
+ spawn(chrome, ['--disable-gpu', '--disable-gpu-sandbox', url], {
99
+ detached: true,
100
+ stdio: 'ignore',
101
+ shell: false,
102
+ }).unref()
103
+ return
104
+ }
76
105
  const cmd = isWin ? 'start' : process.platform === 'darwin' ? 'open' : 'xdg-open'
77
106
  try {
78
107
  spawn(cmd, [url], { detached: true, stdio: 'ignore', shell: isWin }).unref()