triflux 3.3.0-dev.6 → 3.3.0-dev.7
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/bin/triflux.mjs +20 -2
- package/package.json +1 -1
package/bin/triflux.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
// triflux CLI — setup, doctor, version
|
|
3
|
-
import { copyFileSync, existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync, readdirSync, unlinkSync, rmSync, statSync } from "fs";
|
|
3
|
+
import { copyFileSync, existsSync, readFileSync, writeFileSync, mkdirSync, chmodSync, readdirSync, unlinkSync, rmSync, statSync, openSync, closeSync } from "fs";
|
|
4
4
|
import { join, dirname } from "path";
|
|
5
5
|
import { homedir } from "os";
|
|
6
6
|
import { execSync, execFileSync, spawn } from "child_process";
|
|
@@ -1408,7 +1408,25 @@ function stopHubForUpdate() {
|
|
|
1408
1408
|
try { process.kill(info.pid, "SIGKILL"); } catch {}
|
|
1409
1409
|
}
|
|
1410
1410
|
|
|
1411
|
-
|
|
1411
|
+
// Windows에서 better-sqlite3.node 파일 핸들 해제 대기
|
|
1412
|
+
// taskkill 후 프로세스 종료 + 파일 핸들 해제까지 최대 5초
|
|
1413
|
+
const sqliteNode = join(PKG_ROOT, "node_modules", "better-sqlite3", "build", "Release", "better_sqlite3.node");
|
|
1414
|
+
for (let i = 0; i < 10; i++) {
|
|
1415
|
+
sleepMs(500);
|
|
1416
|
+
try { process.kill(info.pid, 0); } catch { break; }
|
|
1417
|
+
}
|
|
1418
|
+
// 파일 잠금 해제 확인 (Windows EBUSY 방지)
|
|
1419
|
+
if (existsSync(sqliteNode)) {
|
|
1420
|
+
for (let i = 0; i < 6; i++) {
|
|
1421
|
+
try {
|
|
1422
|
+
const fd = openSync(sqliteNode, "r");
|
|
1423
|
+
closeSync(fd);
|
|
1424
|
+
break;
|
|
1425
|
+
} catch {
|
|
1426
|
+
sleepMs(500);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
}
|
|
1412
1430
|
try { unlinkSync(HUB_PID_FILE); } catch {}
|
|
1413
1431
|
return info;
|
|
1414
1432
|
}
|