diff --git a/src/helpers/printVersions.ts b/src/helpers/printVersions.ts index b6e7225..3098685 100644 --- a/src/helpers/printVersions.ts +++ b/src/helpers/printVersions.ts @@ -121,7 +121,8 @@ if (process.env.NODE_ENV === "production") { } if (stdout) { - console.log(`assimp ${stdout.split("\n")[5]}`); + const firstLines = (stdout || "").split("\n"); + console.log(`assimp ${firstLines[5] || firstLines[0] || ""}`); } }); diff --git a/tests/helpers/printVersions.test.ts b/tests/helpers/printVersions.test.ts index 1512cd7..1b4a332 100644 --- a/tests/helpers/printVersions.test.ts +++ b/tests/helpers/printVersions.test.ts @@ -27,7 +27,7 @@ mock.module("node:child_process", () => ({ // assimp's real output is multi-line; the source reads line index 5. if (cmd.startsWith("assimp")) { - cb(null, "l1\nl2\nl3\nl4\nl5\nassimp v1.0.0\n"); + cb(null, "l1\nl2\nl3\nl4\nl5\nVersion 1.0.0 (GIT commit abc123)\n"); return; }