Skip to content

Commit a927eb2

Browse files
authored
fix variable problems (#3304)
related to #3302 - fix MM_PORT variable not used in electron - fix to allow full path for MM_CONFIG_FILE variable
1 parent aad3eef commit a927eb2

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ _This release is scheduled to be released on 2024-01-01._
5050
- Fix style issues after prettier update
5151
- Fix calendar test (#3291) by moving "Exdate check" from e2e to electron to run on a Thursday
5252
- Fix calendar config params `fetchInterval` and `excludedEvents` were never used from single calendar config (#3297)
53+
- Fix MM_PORT variable not used in electron and allow full path for MM_CONFIG_FILE variable (#3302)
5354

5455
## [2.25.0] - 2023-10-01
5556

js/app.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Log.log(`Starting MagicMirror: v${global.version}`);
2525
global.root_path = path.resolve(`${__dirname}/../`);
2626

2727
if (process.env.MM_CONFIG_FILE) {
28-
global.configuration_file = process.env.MM_CONFIG_FILE;
28+
global.configuration_file = process.env.MM_CONFIG_FILE.replace(`${global.root_path}/`, "");
2929
}
3030

3131
// FIXME: Hotfix Pull Request

js/electron.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ function createWindow () {
7979
}
8080

8181
let address = (config.address === void 0) | (config.address === "") | (config.address === "0.0.0.0") ? (config.address = "localhost") : config.address;
82-
mainWindow.loadURL(`${prefix}${address}:${config.port}`);
82+
const port = process.env.MM_PORT || config.port;
83+
mainWindow.loadURL(`${prefix}${address}:${port}`);
8384

8485
// Open the DevTools if run with "npm start dev"
8586
if (process.argv.includes("dev")) {

0 commit comments

Comments
 (0)