@simonyea/holysheep-cli 1.1.7 → 1.1.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 +14 -2
package/package.json
CHANGED
package/src/commands/setup.js
CHANGED
|
@@ -51,6 +51,9 @@ async function tryAutoInstall(tool) {
|
|
|
51
51
|
if (process.platform !== 'win32' && !tool.checkInstalled()) {
|
|
52
52
|
console.log(chalk.yellow(` ⚠ 安装后未检测到命令,尝试直接配置...`))
|
|
53
53
|
}
|
|
54
|
+
if (process.platform === 'win32') {
|
|
55
|
+
tool._winJustInstalled = true // 标记为 Windows 刚装的,摘要里特殊处理
|
|
56
|
+
}
|
|
54
57
|
return true // 安装成功就视为可配置
|
|
55
58
|
} catch (e) {
|
|
56
59
|
spinner.fail(`安装失败: ${e.message}`)
|
|
@@ -236,11 +239,20 @@ async function setup(options) {
|
|
|
236
239
|
if (r.tool.hint) console.log(` ${chalk.gray('💡 ' + r.tool.hint)}`)
|
|
237
240
|
// 显示启动命令
|
|
238
241
|
if (r.tool.launchCmd) {
|
|
239
|
-
|
|
242
|
+
if (r.tool._winJustInstalled) {
|
|
243
|
+
// Windows 刚安装:PATH 未刷新,统一用 npx 运行
|
|
244
|
+
const cmdBin = r.tool.launchCmd.split(' ')[0]
|
|
245
|
+
const cmdArgs = r.tool.launchCmd.split(' ').slice(1).join(' ')
|
|
246
|
+
const npxCmd = 'npx ' + cmdBin + (cmdArgs ? ' ' + cmdArgs : '')
|
|
247
|
+
console.log(` ${chalk.gray('▶ 启动命令:')} ${chalk.cyan.bold(npxCmd)}`)
|
|
248
|
+
if (r.tool.launchNote) console.log(` ${chalk.gray(' ' + r.tool.launchNote)}`)
|
|
249
|
+
} else {
|
|
250
|
+
console.log(` ${chalk.gray('▶ 启动命令:')} ${chalk.cyan.bold(r.tool.launchCmd)}`)
|
|
251
|
+
}
|
|
240
252
|
} else if (r.tool.launchNote) {
|
|
241
253
|
console.log(` ${chalk.gray('▶ ' + r.tool.launchNote)}`)
|
|
242
254
|
}
|
|
243
|
-
if (r.tool.launchNote && r.tool.launchCmd) {
|
|
255
|
+
if (r.tool.launchNote && r.tool.launchCmd && !r.tool._winJustInstalled) {
|
|
244
256
|
console.log(` ${chalk.gray(' ' + r.tool.launchNote)}`)
|
|
245
257
|
}
|
|
246
258
|
})
|