Skip to content

Commit

Permalink
add restartAdapters check
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm1957 committed Mar 25, 2024
1 parent bcb15a9 commit 261d5e6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ Branch (`master/main/dev`) is optional.

## Changelog
### **WORK IN PROGRESS**
* (mcm1957) Added check that own adapter is not listed at common.restartAdapters
* (mcm1957) Added check of version strings at common.news
* (mcm1957) Added check for recommended node version (node 18 for now)
* (mcm1957) Disallow common.mode == subscribe
Expand Down
16 changes: 15 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1224,6 +1224,20 @@ function checkIOPackageJson(context) {
}
/* end of foreign check */


if (context.ioPackageJson.common.restartAdapters) {
const restartAdaptersArray = context.ioPackageJson.common.restartAdapters;

// own adapter is not allowed in restart array
if (restartAdaptersArray.includes(context.ioPackageJson.common.name)) {
context.errors.push(`[E176] Own adapter is not allowed to be listed at "common.restartAdapters" in io-pacakge.json`);
} else {
context.checks.push('Own adapter not listed at "common.restartAdapters".');
}
} else {
context.checks.push('"restartAdapters" check skipped as object not present.');
}

if (context.ioPackageJson.common.extIcon) {
return downloadFile(context.ioPackageJson.common.extIcon, null, true)
.then(icon => {
Expand Down Expand Up @@ -1256,7 +1270,7 @@ function checkIOPackageJson(context) {
}
// do not put any code behind this line

// max number is E175
// max number is E176
}
});
});
Expand Down

0 comments on commit 261d5e6

Please sign in to comment.