Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #94 - modules walking code should check for the type correctly #95

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ By "committing" to this file, you ("you" or "You") hereby grant to Linnovate and

You, the contributor agree to the following…

1. That you are the sole owner of the Contributions and/or have sufficient rights in your Contribution to grant all rights you grant hereunder.
1. That you are the sole owner of the Contributions and/or have sufficient rights in your Contribution to grant all rights you grant hereunder.
1. That the Contributions are your original works of authorship.
1. That you created the Contributions and did not copy them from another source, and no other person claims, or has the right to claim, any right in any invention or patent related to the Contributions.
1. That you are legally entitled to grant the above license. (If your employer has rights to intellectual property that you create, you represent that you have received permission to make the Contributions on behalf of that employer, or that your employer has waived such rights for the Contributions.)
Expand All @@ -35,7 +35,8 @@ If you become aware of any facts or circumstances related to the representation
* Taylor Thomas {thomastaylor312}
* David Büttner {zloKOMAtic}
* Andrija Petrovic {andrija-hers}
* John Morris {spxis}
* John Morris {spxis}
* Liran Tal {lirantal}
* Farhad Adeli {Exlord}
* Rommel Juarez {juarez9j}
* David Dasenbrook {sometea}
6 changes: 4 additions & 2 deletions lib/core_modules/module/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ function walk(wpath, type, excludeDir, callback) {
fs.readdirSync(wpath).forEach(function(file) {
var newPath = path.join(wpath, file);
var stat = fs.statSync(newPath);
if (stat.isFile() && (rgx.test(file) || (baseRgx.test(file)) && ~newPath.indexOf(type))) {
if (stat.isFile() && (rgx.test(file) || (baseRgx.test(file)) &&
~newPath.split(path.sep).indexOf(type+'s'))) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected use of '~'.

// if (!rgx.test(file)) console.log(' Consider updating filename:', newPath);
callback(newPath);
} else if (stat.isDirectory() && file !== excludeDir && ~newPath.indexOf(type)) {
} else if (stat.isDirectory() && file !== excludeDir &&
~newPath.split(path.sep).indexOf(type+'s')) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected use of '~'.

walk(newPath, type, excludeDir, callback);
}
});
Expand Down