Skip to content

Commit 84bc50d

Browse files
committed
run systeminformation in subprocess so the info is always displayed
1 parent 950f551 commit 84bc50d

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

js/app.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ require("./alias-resolver");
33

44
const fs = require("node:fs");
55
const path = require("node:path");
6+
const Spawn = require("node:child_process").spawn;
67
const envsub = require("envsub");
78
const Log = require("logger");
89

@@ -25,7 +26,7 @@ global.mmTestMode = process.env.mmTestMode === "true";
2526
Log.log(`Starting MagicMirror: v${global.version}`);
2627

2728
// Log system information.
28-
Utils.logSystemInformation(global.version);
29+
Spawn("node ./js/systeminformation.js", { cwd: this.root_path, shell: true, detached: true, stdio: "inherit" });
2930

3031
if (process.env.MM_CONFIG_FILE) {
3132
global.configuration_file = process.env.MM_CONFIG_FILE.replace(`${global.root_path}/`, "");

js/systeminformation.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
const mmVersion = require("../package").version;
2+
const { logSystemInformation } = require("./utils");
3+
4+
logSystemInformation(`v${mmVersion}`);

js/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const os = require("node:os");
22
const fs = require("node:fs");
33
const si = require("systeminformation");
4-
const Log = require("logger");
4+
const Log = require("./logger"); // needed with relative path because logSystemInformation is called in an own process in app.js
55

66
const modulePositions = []; // will get list from index.html
77
const regionRegEx = /"region ([^"]*)/i;

0 commit comments

Comments
 (0)