@sokeai/cli 1.0.14 → 1.0.15
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/scripts/install.js +4 -6
package/package.json
CHANGED
package/scripts/install.js
CHANGED
|
@@ -278,13 +278,11 @@ async function maybeAssistGuiPath() {
|
|
|
278
278
|
const { spawn } = require('child_process');
|
|
279
279
|
const child = spawn(process.execPath, [runJsPath, 'setup-gui-env', '--silent'], {
|
|
280
280
|
stdio: 'ignore', // 静默执行,不污染 npm install 输出
|
|
281
|
-
detached: true
|
|
281
|
+
detached: true // 允许子进程独立于父进程运行
|
|
282
282
|
});
|
|
283
|
-
|
|
284
|
-
child.
|
|
285
|
-
|
|
286
|
-
// 避免卡住
|
|
287
|
-
setTimeout(() => resolve(), 3000);
|
|
283
|
+
// 断开与子进程的联系,让它在后台自己跑,不阻塞 npm 安装退出
|
|
284
|
+
child.unref();
|
|
285
|
+
resolve();
|
|
288
286
|
} catch (e) {
|
|
289
287
|
resolve();
|
|
290
288
|
}
|