@bobfrankston/mailx 1.0.34 → 1.0.35
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/mailx.js +30 -8
- package/client/compose/compose.html +1 -1
- package/package.json +2 -2
package/bin/mailx.js
CHANGED
|
@@ -42,21 +42,43 @@ function log(...msg) { if (verbose) console.log("[mailx]", ...msg); }
|
|
|
42
42
|
if (hasFlag("kill")) {
|
|
43
43
|
log("Killing mailx processes...");
|
|
44
44
|
const { execSync } = await import("node:child_process");
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
let killed = 0;
|
|
46
|
+
|
|
47
|
+
if (process.platform === "win32") {
|
|
48
|
+
// Kill by port
|
|
49
|
+
try {
|
|
48
50
|
const out = execSync(`netstat -ano | findstr :${PORT} | findstr LISTENING`, { encoding: "utf-8" }).trim();
|
|
49
51
|
const pids = [...new Set(out.split("\n").map(l => l.trim().split(/\s+/).pop()).filter(Boolean))];
|
|
50
52
|
for (const pid of pids) {
|
|
51
|
-
try { execSync(`taskkill /F /PID ${pid}`, { stdio: "pipe" }); console.log(`Killed PID ${pid}`); } catch { /* */ }
|
|
53
|
+
try { execSync(`taskkill /F /PID ${pid}`, { stdio: "pipe" }); console.log(`Killed PID ${pid} (port ${PORT})`); killed++; } catch { /* */ }
|
|
52
54
|
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
} catch { /* no process on port */ }
|
|
56
|
+
|
|
57
|
+
// Kill any node.exe holding handles on the mailx install directory
|
|
58
|
+
const installDir = path.join(import.meta.dirname, "..");
|
|
59
|
+
try {
|
|
60
|
+
const wmic = execSync(`wmic process where "name='node.exe'" get processid,commandline /format:csv`, { encoding: "utf-8" });
|
|
61
|
+
for (const line of wmic.split("\n")) {
|
|
62
|
+
if (line.includes("mailx-server") || line.includes("mailx\\packages")) {
|
|
63
|
+
const pid = line.trim().split(",").pop();
|
|
64
|
+
if (pid && /^\d+$/.test(pid)) {
|
|
65
|
+
try { execSync(`taskkill /F /PID ${pid}`, { stdio: "pipe" }); console.log(`Killed PID ${pid} (mailx node process)`); killed++; } catch { /* */ }
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
} catch { /* */ }
|
|
70
|
+
|
|
71
|
+
// Kill mailx-app.exe
|
|
72
|
+
try { execSync("taskkill /F /IM mailx-app.exe", { stdio: "pipe" }); console.log("Killed mailx-app.exe"); killed++; } catch { /* */ }
|
|
73
|
+
} else {
|
|
74
|
+
try { execSync(`fuser -k ${PORT}/tcp`, { stdio: "pipe" }); console.log(`Killed process on port ${PORT}`); killed++; } catch { /* */ }
|
|
75
|
+
}
|
|
76
|
+
|
|
57
77
|
// Remove lock file
|
|
58
78
|
const lockPath = path.join(process.env.USERPROFILE || process.env.HOME || ".", ".mailx", "mailx-app.lock");
|
|
59
79
|
try { fs.unlinkSync(lockPath); log("Removed lock file"); } catch { /* */ }
|
|
80
|
+
|
|
81
|
+
if (killed === 0) console.log("No mailx processes found");
|
|
60
82
|
process.exit(0);
|
|
61
83
|
}
|
|
62
84
|
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
6
|
<title>Compose - mailx</title>
|
|
7
7
|
<link rel="icon" type="image/svg+xml" href="../favicon.svg">
|
|
8
|
-
<link rel="stylesheet" href="../styles/
|
|
8
|
+
<link rel="stylesheet" href="../styles/variables.css">
|
|
9
9
|
<link href="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.snow.css" rel="stylesheet">
|
|
10
10
|
<link rel="stylesheet" href="compose.css">
|
|
11
11
|
<script src="https://cdn.jsdelivr.net/npm/quill@2/dist/quill.js"></script>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bobfrankston/mailx",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.35",
|
|
4
4
|
"description": "Local-first email client with IMAP sync and standalone native app",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "bin/mailx.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"postinstall": "node launcher/builder/postinstall.js"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@bobfrankston/iflow": "^1.0.
|
|
23
|
+
"@bobfrankston/iflow": "^1.0.6",
|
|
24
24
|
"@bobfrankston/miscinfo": "^1.0.6",
|
|
25
25
|
"@bobfrankston/oauthsupport": "^1.0.11",
|
|
26
26
|
"@bobfrankston/rust-builder": "^0.1.2",
|