bhg-helper 1.0.5 → 1.0.6

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.
Files changed (2) hide show
  1. package/cli/cli.js +19 -8
  2. package/package.json +1 -1
package/cli/cli.js CHANGED
@@ -210,14 +210,25 @@ async function apiHealth() {
210
210
 
211
211
  async function ensureBackend() {
212
212
  if (await apiHealth()) return true
213
- const npmCmd = process.platform === 'win32' ? 'npm.cmd' : 'npm'
214
- const child = spawn(npmCmd, ['run', 'server:raw'], {
215
- cwd: PROJECT_ROOT,
216
- detached: true,
217
- stdio: 'ignore',
218
- shell: false,
219
- })
220
- child.unref()
213
+ try {
214
+ if (process.platform === 'win32') {
215
+ execSync('start "" /min cmd /c "npm run server:raw"', {
216
+ cwd: PROJECT_ROOT,
217
+ stdio: 'ignore',
218
+ shell: true,
219
+ })
220
+ } else {
221
+ const child = spawn('npm', ['run', 'server:raw'], {
222
+ cwd: PROJECT_ROOT,
223
+ detached: true,
224
+ stdio: 'ignore',
225
+ shell: false,
226
+ })
227
+ child.unref()
228
+ }
229
+ } catch {
230
+ return false
231
+ }
221
232
  await new Promise(resolve => setTimeout(resolve, 1500))
222
233
  return await apiHealth()
223
234
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bhg-helper",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "BHG-helper:AI 编程工具 DeepSeek 中转 & 可视化配置工具",
5
5
  "type": "module",
6
6
  "bin": {