Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Thanks to: @dathbe.
- [clock] Add CSS to prevent line breaking of sunset/sunrise time display (#3816)
- [core] Enhance system information logging format and include additional env and RAM details (#3839, #3843)
- [refactor] Add new file `js/module_functions.js` to move code used in several modules to one place (#3837)
- [refactor] Use global.root_path where possible (#3883)
- [refactor] Use global.root_path where possible (#3883, #3885)
- [tests] refactor: simplify jest config file (#3844)
- [tests] refactor: extract constants for weather electron tests (#3845)
- [tests] refactor: add `setupDOMEnvironment` helper function to eliminate repetitive JSDOM setup code (#3860)
Expand Down
7 changes: 4 additions & 3 deletions js/check_config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ const Ajv = require("ajv");
const globals = require("globals");
const { Linter } = require("eslint");

const Log = require(`${global.root_path}/js/logger.js`);
const Utils = require(`${global.root_path}/js/utils.js`);
const rootPath = path.resolve(`${__dirname}/../`);
const Log = require(`${rootPath}/js/logger.js`);
const Utils = require(`${rootPath}/js/utils.js`);

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

/**
Expand Down
5 changes: 4 additions & 1 deletion js/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
const Log = require(`${global.root_path}/js/logger.js`);
const path = require("node:path");

const rootPath = path.resolve(`${__dirname}/../`);
const Log = require(`${rootPath}/js/logger.js`);
const os = require("node:os");
const fs = require("node:fs");
const si = require("systeminformation");
Expand Down