chatroom-cli 1.0.67 → 1.0.68
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/index.js +12 -3
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -12570,16 +12570,24 @@ var init_artifact = __esm(() => {
|
|
|
12570
12570
|
});
|
|
12571
12571
|
|
|
12572
12572
|
// src/commands/machine/pid.ts
|
|
12573
|
+
import { createHash } from "node:crypto";
|
|
12573
12574
|
import { existsSync as existsSync4, readFileSync as readFileSync6, writeFileSync as writeFileSync4, unlinkSync as unlinkSync2, mkdirSync as mkdirSync4 } from "node:fs";
|
|
12574
12575
|
import { homedir as homedir4 } from "node:os";
|
|
12575
12576
|
import { join as join5 } from "node:path";
|
|
12577
|
+
function getUrlHash() {
|
|
12578
|
+
const url = getConvexUrl();
|
|
12579
|
+
return createHash("sha256").update(url).digest("hex").substring(0, 8);
|
|
12580
|
+
}
|
|
12581
|
+
function getPidFileName() {
|
|
12582
|
+
return `daemon-${getUrlHash()}.pid`;
|
|
12583
|
+
}
|
|
12576
12584
|
function ensureChatroomDir() {
|
|
12577
12585
|
if (!existsSync4(CHATROOM_DIR4)) {
|
|
12578
12586
|
mkdirSync4(CHATROOM_DIR4, { recursive: true, mode: 448 });
|
|
12579
12587
|
}
|
|
12580
12588
|
}
|
|
12581
12589
|
function getPidFilePath() {
|
|
12582
|
-
return join5(CHATROOM_DIR4,
|
|
12590
|
+
return join5(CHATROOM_DIR4, getPidFileName());
|
|
12583
12591
|
}
|
|
12584
12592
|
function isProcessRunning(pid) {
|
|
12585
12593
|
try {
|
|
@@ -12632,7 +12640,7 @@ function isDaemonRunning() {
|
|
|
12632
12640
|
function acquireLock() {
|
|
12633
12641
|
const { running, pid } = isDaemonRunning();
|
|
12634
12642
|
if (running) {
|
|
12635
|
-
console.error(`❌ Daemon already running (PID: ${pid})`);
|
|
12643
|
+
console.error(`❌ Daemon already running for ${getConvexUrl()} (PID: ${pid})`);
|
|
12636
12644
|
return false;
|
|
12637
12645
|
}
|
|
12638
12646
|
writePid();
|
|
@@ -12641,8 +12649,9 @@ function acquireLock() {
|
|
|
12641
12649
|
function releaseLock() {
|
|
12642
12650
|
removePid();
|
|
12643
12651
|
}
|
|
12644
|
-
var CHATROOM_DIR4
|
|
12652
|
+
var CHATROOM_DIR4;
|
|
12645
12653
|
var init_pid = __esm(() => {
|
|
12654
|
+
init_client2();
|
|
12646
12655
|
CHATROOM_DIR4 = join5(homedir4(), ".chatroom");
|
|
12647
12656
|
});
|
|
12648
12657
|
|