Skip to content

Commit b500149

Browse files
committed
revert changes breaking node --run config:check
1 parent b1865d8 commit b500149

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Thanks to: @dathbe.
2424
- [clock] Add CSS to prevent line breaking of sunset/sunrise time display (#3816)
2525
- [core] Enhance system information logging format and include additional env and RAM details (#3839, #3843)
2626
- [refactor] Add new file `js/module_functions.js` to move code used in several modules to one place (#3837)
27-
- [refactor] Use global.root_path where possible (#3883)
27+
- [refactor] Use global.root_path where possible (#3883, #3885)
2828
- [tests] refactor: simplify jest config file (#3844)
2929
- [tests] refactor: extract constants for weather electron tests (#3845)
3030
- [tests] refactor: add `setupDOMEnvironment` helper function to eliminate repetitive JSDOM setup code (#3860)

js/check_config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ const Ajv = require("ajv");
55
const globals = require("globals");
66
const { Linter } = require("eslint");
77

8-
const Log = require(`${global.root_path}/js/logger.js`);
9-
const Utils = require(`${global.root_path}/js/utils.js`);
8+
const rootPath = path.resolve(`${__dirname}/../`);
9+
const Log = require(`${rootPath}/js/logger.js`);
10+
const Utils = require(`${rootPath}/js/utils.js`);
1011

1112
const linter = new Linter({ configType: "flat" });
1213
const ajv = new Ajv();
@@ -18,7 +19,7 @@ const ajv = new Ajv();
1819
*/
1920
function getConfigFile () {
2021
// FIXME: This function should be in core. Do you want refactor me ;) ?, be good!
21-
return path.resolve(process.env.MM_CONFIG_FILE || `${global.root_path}/config/config.js`);
22+
return path.resolve(process.env.MM_CONFIG_FILE || `${rootPath}/config/config.js`);
2223
}
2324

2425
/**

js/utils.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
const Log = require(`${global.root_path}/js/logger.js`);
1+
const path = require("node:path");
2+
3+
const rootPath = path.resolve(`${__dirname}/../`);
4+
const Log = require(`${rootPath}/js/logger.js`);
25
const os = require("node:os");
36
const fs = require("node:fs");
47
const si = require("systeminformation");

0 commit comments

Comments
 (0)