@askexenow/exe-os 0.8.48 → 0.8.49
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/dist/bin/install.js +20 -0
- package/package.json +1 -1
package/dist/bin/install.js
CHANGED
|
@@ -672,6 +672,25 @@ function summarizeSymlinkResults(results) {
|
|
|
672
672
|
}
|
|
673
673
|
|
|
674
674
|
// src/bin/install.ts
|
|
675
|
+
import { existsSync as existsSync5, readFileSync as readFileSync4, unlinkSync } from "fs";
|
|
676
|
+
import path5 from "path";
|
|
677
|
+
import { homedir } from "os";
|
|
678
|
+
function killStaleDaemon() {
|
|
679
|
+
try {
|
|
680
|
+
const pidPath = path5.join(homedir(), ".exe-os", "exed.pid");
|
|
681
|
+
if (!existsSync5(pidPath)) return;
|
|
682
|
+
const pid = parseInt(readFileSync4(pidPath, "utf8").trim(), 10);
|
|
683
|
+
if (isNaN(pid)) return;
|
|
684
|
+
process.kill(pid, "SIGTERM");
|
|
685
|
+
try {
|
|
686
|
+
unlinkSync(pidPath);
|
|
687
|
+
} catch {
|
|
688
|
+
}
|
|
689
|
+
process.stderr.write(`exe-os: restarted daemon (PID ${pid}) for new version
|
|
690
|
+
`);
|
|
691
|
+
} catch {
|
|
692
|
+
}
|
|
693
|
+
}
|
|
675
694
|
var args = process.argv.slice(2);
|
|
676
695
|
if (args.includes("--commands-only")) {
|
|
677
696
|
try {
|
|
@@ -688,6 +707,7 @@ if (args.includes("--commands-only")) {
|
|
|
688
707
|
} else if (args.includes("--global")) {
|
|
689
708
|
try {
|
|
690
709
|
await runInstaller();
|
|
710
|
+
killStaleDaemon();
|
|
691
711
|
} catch (err) {
|
|
692
712
|
console.error(
|
|
693
713
|
"Installation failed:",
|
package/package.json
CHANGED