added error message if <modulename>.js file is missing … (#3015)

… in module folder to get a hint in the logs

fixes #2403
This commit is contained in:
Karsten Hassel 2023-01-26 12:45:17 +01:00 committed by GitHub
parent 67e4dbaacd
commit 157e74ce7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View File

@ -15,6 +15,7 @@ _This release is scheduled to be released on 2023-04-01._
- Added tests for hourly weather forecast - Added tests for hourly weather forecast
- Added possibility to ignore MagicMirror repo in updatenotification module - Added possibility to ignore MagicMirror repo in updatenotification module
- Added Pirate Weather as new weather provider (#3005) - Added Pirate Weather as new weather provider (#3005)
- Added error message if `<modulename>.js` file is missing in module folder to get a hint in the logs (#2403)
### Removed ### Removed

View File

@ -113,6 +113,14 @@ function App() {
moduleFolder = `${__dirname}/../modules/default/${module}`; moduleFolder = `${__dirname}/../modules/default/${module}`;
} }
const moduleFile = `${moduleFolder}/${module}.js`;
try {
fs.accessSync(moduleFile, fs.R_OK);
} catch (e) {
Log.warn(`No ${moduleFile} found for module: ${moduleName}.`);
}
const helperPath = `${moduleFolder}/node_helper.js`; const helperPath = `${moduleFolder}/node_helper.js`;
let loadHelper = true; let loadHelper = true;