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.
- package/cli/cli.js +19 -8
- 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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
}
|