@simonyea/holysheep-cli 1.7.29 → 1.7.31

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.29",
3
+ "version": "1.7.31",
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/index.js CHANGED
@@ -4,15 +4,8 @@
4
4
  const { program } = require('commander')
5
5
  const chalk = require('chalk')
6
6
  const pkg = require('../package.json')
7
- const { installWindowsCliShims, ensureWindowsUserPathHasNpmBin } = require('./utils/shell')
8
7
 
9
- // Windows 用户:检测 npm bin 路径是否在 PATH 中
10
- if (process.platform === 'win32') {
11
- try {
12
- installWindowsCliShims()
13
- ensureWindowsUserPathHasNpmBin()
14
- } catch {}
15
- }
8
+
16
9
 
17
10
  // 异步检查最新版本(不阻塞主流程)
18
11
  function checkLatestVersion() {
@@ -126,12 +126,12 @@ function installWindowsCliShims() {
126
126
  fs.mkdirSync(npmBin, { recursive: true })
127
127
 
128
128
  const cliSpec = `@simonyea/holysheep-cli@${pkg.version}`
129
- // 优先使用本地安装的包(npm install -g 场景),避免依赖 PATH 中的 hs 命令
129
+ // %APPDATA% 展开路径(比 %~dp0 cmd.exe 里更可靠)
130
130
  const cmdContent = [
131
131
  '@echo off',
132
132
  'setlocal',
133
- 'if exist "%~dp0node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js" (',
134
- ' node "%~dp0node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js" %*',
133
+ 'if exist "%APPDATA%\\npm\\node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js" (',
134
+ ' node "%APPDATA%\\npm\\node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js" %*',
135
135
  ') else if exist "%~dp0npx.cmd" (',
136
136
  ` call "%~dp0npx.cmd" ${cliSpec} %*`,
137
137
  ') else (',
@@ -141,12 +141,11 @@ function installWindowsCliShims() {
141
141
  ].join('\r\n')
142
142
 
143
143
  const ps1Content = [
144
- '$dir = $PSScriptRoot',
145
- '$localPkg = Join-Path $dir "node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js"',
144
+ '$localPkg = "$env:APPDATA\\npm\\node_modules\\@simonyea\\holysheep-cli\\bin\\hs.js"',
146
145
  'if (Test-Path $localPkg) {',
147
146
  ' & node $localPkg @args',
148
- '} elseif (Test-Path (Join-Path $dir "npx.cmd")) {',
149
- ` & (Join-Path $dir "npx.cmd") "${cliSpec}" @args`,
147
+ '} elseif (Test-Path (Join-Path $PSScriptRoot "npx.cmd")) {',
148
+ ` & (Join-Path $PSScriptRoot "npx.cmd") "${cliSpec}" @args`,
150
149
  '} else {',
151
150
  ` & npx "${cliSpec}" @args`,
152
151
  '}',