File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff 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 )
Original file line number Diff line number Diff line change @@ -5,8 +5,9 @@ const Ajv = require("ajv");
55const globals = require ( "globals" ) ;
66const { 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
1112const linter = new Linter ( { configType : "flat" } ) ;
1213const ajv = new Ajv ( ) ;
@@ -18,7 +19,7 @@ const ajv = new Ajv();
1819 */
1920function 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/**
Original file line number Diff line number Diff line change 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` ) ;
25const os = require ( "node:os" ) ;
36const fs = require ( "node:fs" ) ;
47const si = require ( "systeminformation" ) ;
You can’t perform that action at this time.
0 commit comments