@simonyea/holysheep-cli 1.7.30 → 1.7.32
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 +8 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@simonyea/holysheep-cli",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.32",
|
|
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
|
@@ -125,17 +125,16 @@ function installWindowsCliShims() {
|
|
|
125
125
|
const npmBin = path.join(appData, 'npm')
|
|
126
126
|
fs.mkdirSync(npmBin, { recursive: true })
|
|
127
127
|
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
if (fs.existsSync(globalEntry)) return []
|
|
128
|
+
// 如果 hs.cmd 已存在(npm install -g 生成的),不覆盖
|
|
129
|
+
if (fs.existsSync(path.join(npmBin, 'hs.cmd'))) return []
|
|
131
130
|
|
|
132
131
|
const cliSpec = `@simonyea/holysheep-cli@${pkg.version}`
|
|
133
|
-
//
|
|
132
|
+
// 用 %APPDATA% 展开路径(比 %~dp0 在 cmd.exe 里更可靠)
|
|
134
133
|
const cmdContent = [
|
|
135
134
|
'@echo off',
|
|
136
135
|
'setlocal',
|
|
137
|
-
'if exist "
|
|
138
|
-
' node "
|
|
136
|
+
'if exist "%APPDATA%\\npm\\node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js" (',
|
|
137
|
+
' node "%APPDATA%\\npm\\node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js" %*',
|
|
139
138
|
') else if exist "%~dp0npx.cmd" (',
|
|
140
139
|
` call "%~dp0npx.cmd" ${cliSpec} %*`,
|
|
141
140
|
') else (',
|
|
@@ -145,12 +144,11 @@ function installWindowsCliShims() {
|
|
|
145
144
|
].join('\r\n')
|
|
146
145
|
|
|
147
146
|
const ps1Content = [
|
|
148
|
-
'$
|
|
149
|
-
'$localPkg = Join-Path $dir "node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js"',
|
|
147
|
+
'$localPkg = "$env:APPDATA\\npm\\node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js"',
|
|
150
148
|
'if (Test-Path $localPkg) {',
|
|
151
149
|
' & node $localPkg @args',
|
|
152
|
-
'} elseif (Test-Path (Join-Path $
|
|
153
|
-
` & (Join-Path $
|
|
150
|
+
'} elseif (Test-Path (Join-Path $PSScriptRoot "npx.cmd")) {',
|
|
151
|
+
` & (Join-Path $PSScriptRoot "npx.cmd") "${cliSpec}" @args`,
|
|
154
152
|
'} else {',
|
|
155
153
|
` & npx "${cliSpec}" @args`,
|
|
156
154
|
'}',
|