← Commit history

v0.11.6: flush stdout before process::exit on every serve path — Rust block-buffers stdout when it is a pipe (always, under the dock) and process::exit discards the buffer, so buffered ERROR reports could vanish exactly the way the URL did

John Lauer ·03adac10d6 ·1mo ago ·parent 034b54e
5 files changed +11−4
Cargo.lock+1−1
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-project-manager"-version = "0.11.5"+version = "0.11.6" dependencies = [  "altium-codec",  "anyhow",
Cargo.toml+1−1
@@ -1,6 +1,6 @@ [package] name = "adom-project-manager"-version = "0.11.5"+version = "0.11.6" edition = "2021" description = "Adom Project Manager — the central hub for navigating wiki boards, molecules, and libraries into Hydrogen: browse your wiki boards/projects, view symbol + footprint + 3D and the footprint layer stackup, add components to your KiCad/Altium libraries, and deliver self-contained KiCad projects. Built on adom-lbr." 
bin/adom-project-manager
⋯ 1 unchanged line ⋯
package.json+1−1
@@ -1,6 +1,6 @@ {   "slug": "adom-project-manager",-  "version": "0.11.5",+  "version": "0.11.6",   "type": "app",   "description": "Adom Project Manager — the central hub for navigating wiki boards, molecules and libraries into Hydrogen: browse your wiki boards/projects (Personal / Organization / Public), view symbol + footprint + 3D and the per-EDA footprint layer stackup, explore the board and schematic in INTERACTIVE cross-probing viewers (click a net, hover a part for stock and price), add components to your KiCad/Altium libraries, and deliver self-contained KiCad projects. Built on adom-lbr. (Formerly Adom Project Manager / adom-project-manager.)",   "dependencies": {
src/main.rs+8−1
@@ -44,7 +44,14 @@ fn main() {         }     }     if serve {-        std::process::exit(serve_cmd(port));+        let code = serve_cmd(port);+        // std::process::exit runs no destructors, and Rust's stdout is BLOCK+        // buffered when it is a pipe (which it always is under the dock), so an+        // unflushed buffer is discarded outright. The URL line uses a raw+        // write(2), but the ERROR paths print through the buffer — flush before+        // exiting or a failure report can vanish exactly like the URL did.+        let _ = std::io::Write::flush(&mut std::io::stdout());+        std::process::exit(code);     }     if let Err(e) = run(port.unwrap_or(8785)) {         eprintln!("ERROR: {e}");