Skip to content

Commit

Permalink
Changed how npm package folders are detected
Browse files Browse the repository at this point in the history
  • Loading branch information
dutzi committed Jun 13, 2016
1 parent 58584fd commit 40b8d49
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/cli/add.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ function promptForIgnoredFolders(src, rules) {
var prompts = [];

rules.forEach((rule) => {
if (isThere(path.resolve(src, rule.folder))) {
if (isThere(path.resolve(src, rule.relPath))) {
prompts.push({
name: rule.name,
message: rule.message,
Expand All @@ -32,7 +32,7 @@ function promptForIgnoredFolders(src, rules) {

rules.forEach((rule) => {
if (answers[rule.name]) {
ignoredFolders.push(rule.folder);
ignoredFolders.push(rule.ignore);
}
});

Expand Down Expand Up @@ -70,12 +70,14 @@ exports.handler = function (argv) {

promptForIgnoredFolders(src, [{
name: 'git',
folder: '.git',
relPath: '.git',
ignore: '.git',
message: 'Source folder is a git repo, add `.git` to ignored folders?',
default: true
}, {
name: 'npm',
folder: 'node_modules',
relPath: 'package.json',
ignore: 'node_modules',
message: 'Source folder is an npm package, add `node_modules` to ignored folders?',
default: true
}]).then((ignoredFolders) => {
Expand Down

0 comments on commit 40b8d49

Please sign in to comment.