Skip to content

Commit

Permalink
"[E500] node_modules found" has been retricted to adapetr root. [#297]
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm1957 committed Oct 4, 2024
1 parent dfa5a50 commit e324707
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Branch (`master/main/dev`) is optional.
### **WORK IN PROGRESS**
* (mcm1957) "[E166] 'common.mode: extension' is unknown" has been fixed [#308]
* (mcm1957) "[E904] file iob_npm.done found in repository, but not found in .gitignore" removed as covered by [E503]. [#309]
* (mcm1957) "[E500] node_modules found" has been retricted to adapetr root. [#297]

### 3.1.0 (2024-09-29)
* (mcm1957) "@iobroker/plugin-sentry" blacklisted as dependency [#301]
Expand Down
10 changes: 8 additions & 2 deletions lib/M500_Code.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,20 @@ async function checkCode(context) {
const promises = [];
await (function () { return new Promise(_resolve => {
common.debug('init bufferstream');
let root='';
bufferStream
.pipe(unzipper.Parse())
.on('entry', entry => {
common.debug('on.entry ' + entry.path);
if (!found && entry.type === 'Directory' && entry.path.match(/\/node_modules\/$/)) {
if (root === '') {
root=entry.path;
console.log(`Directory root set to ${root}`);
}
//if (!found && entry.type === 'Directory' && entry.path.match(/\/node_modules\/$/)) {
if (!found && entry.type === 'Directory' && entry.path === `${root}node_modules/`) {
console.log(`Found ${entry.path}`);
found = true;
context.errors.push('[E500] node_modules found in repo. Please delete it');
context.errors.push('[E500] Directory node_modules found in root of repository. Please delete directory.');
}

// Get a list of all files and `.npmignore` + `.gitignore`
Expand Down

0 comments on commit e324707

Please sign in to comment.