@simonyea/holysheep-cli 1.7.7 → 1.7.9
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/commands/setup.js +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.9",
|
|
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/commands/setup.js
CHANGED
|
@@ -29,6 +29,10 @@ const AUTO_INSTALL = {
|
|
|
29
29
|
function getWindowsImmediateLaunchCmd(tool) {
|
|
30
30
|
if (process.platform !== 'win32' || !tool?.launchCmd) return null
|
|
31
31
|
|
|
32
|
+
if (/^npx\b/i.test(tool.launchCmd)) {
|
|
33
|
+
return tool.launchCmd
|
|
34
|
+
}
|
|
35
|
+
|
|
32
36
|
const [cmdBin, ...cmdArgs] = tool.launchCmd.split(' ')
|
|
33
37
|
|
|
34
38
|
try {
|
|
@@ -48,6 +52,19 @@ function getWindowsImmediateLaunchCmd(tool) {
|
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
function getPreferredCliPrefix() {
|
|
55
|
+
if (process.platform === 'win32') {
|
|
56
|
+
return 'npx @simonyea/holysheep-cli@latest'
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const mainEntry = String(require.main?.filename || '')
|
|
60
|
+
const runningFromNpxCache =
|
|
61
|
+
/[\\/]_npx[\\/]/i.test(mainEntry) ||
|
|
62
|
+
/[\\/]npm-cache[\\/]/i.test(mainEntry)
|
|
63
|
+
|
|
64
|
+
if (runningFromNpxCache) {
|
|
65
|
+
return `npx @simonyea/holysheep-cli@${pkg.version}`
|
|
66
|
+
}
|
|
67
|
+
|
|
51
68
|
return commandExists('hs')
|
|
52
69
|
? 'hs'
|
|
53
70
|
: `npx @simonyea/holysheep-cli@${pkg.version}`
|