@simonyea/holysheep-cli 1.7.29 → 1.7.30
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/index.js +1 -8
- package/src/utils/shell.js +4 -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.30",
|
|
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
|
-
|
|
10
|
-
if (process.platform === 'win32') {
|
|
11
|
-
try {
|
|
12
|
-
installWindowsCliShims()
|
|
13
|
-
ensureWindowsUserPathHasNpmBin()
|
|
14
|
-
} catch {}
|
|
15
|
-
}
|
|
8
|
+
|
|
16
9
|
|
|
17
10
|
// 异步检查最新版本(不阻塞主流程)
|
|
18
11
|
function checkLatestVersion() {
|
package/src/utils/shell.js
CHANGED
|
@@ -125,6 +125,10 @@ function installWindowsCliShims() {
|
|
|
125
125
|
const npmBin = path.join(appData, 'npm')
|
|
126
126
|
fs.mkdirSync(npmBin, { recursive: true })
|
|
127
127
|
|
|
128
|
+
// 已 npm install -g:npm 自己生成的 hs.cmd 已可用,不覆盖
|
|
129
|
+
const globalEntry = path.join(npmBin, 'node_modules', '@simonyea', 'holysheep-cli', 'bin', 'hs.js')
|
|
130
|
+
if (fs.existsSync(globalEntry)) return []
|
|
131
|
+
|
|
128
132
|
const cliSpec = `@simonyea/holysheep-cli@${pkg.version}`
|
|
129
133
|
// 优先使用本地安装的包(npm install -g 场景),避免依赖 PATH 中的 hs 命令
|
|
130
134
|
const cmdContent = [
|