refactor: use global.root_path instead relative paths (#3883)

This commit is contained in:
Karsten Hassel
2025-09-09 08:09:45 +02:00
committed by GitHub
parent 31bafc3297
commit b1865d8115
16 changed files with 34 additions and 35 deletions

View File

@@ -5,9 +5,8 @@ const Ajv = require("ajv");
const globals = require("globals");
const { Linter } = require("eslint");
const rootPath = path.resolve(`${__dirname}/../`);
const Log = require(`${rootPath}/js/logger.js`);
const Utils = require(`${rootPath}/js/utils.js`);
const Log = require(`${global.root_path}/js/logger.js`);
const Utils = require(`${global.root_path}/js/utils.js`);
const linter = new Linter({ configType: "flat" });
const ajv = new Ajv();
@@ -19,7 +18,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 || `${rootPath}/config/config.js`);
return path.resolve(process.env.MM_CONFIG_FILE || `${global.root_path}/config/config.js`);
}
/**