Skip to content

Commit

Permalink
Upgrade: ignore major.
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Mar 27, 2016
1 parent 2ebe566 commit c72f6c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
19 changes: 10 additions & 9 deletions lib/util/get-npmignore.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
// Requirements
//------------------------------------------------------------------------------

var fs = require("fs");
var path = require("path");
var Ignore = require("ignore").Ignore;
var ignore = require("ignore");
var Cache = require("./cache");
var exists = require("./exists");
var getPackageJson = require("./get-package-json");
Expand Down Expand Up @@ -100,20 +101,20 @@ function parseWhiteList(files) {
return null;
}

var ignore = new Ignore({twoGlobstars: true});
ignore.addPattern("*");
var ig = ignore();
ig.add("*");

for (var i = 0; i < files.length; ++i) {
var file = files[i];

if (typeof file === "string") {
file = "/" + file.replace(SLASH_AT_BEGIN_END, "");
ignore.addPattern("!" + file);
ignore.addPattern("!" + file + "/**");
ig.add("!" + file);
ig.add("!" + file + "/**");
}
}

return not(ignore.createFilter());
return not(ig.createFilter());
}

/**
Expand All @@ -136,9 +137,9 @@ function parseNpmignore(basedir, filesFieldExists) {
}
}

var ignore = new Ignore({twoGlobstars: true});
ignore.addIgnoreFile(filePath);
return not(ignore.createFilter());
var ig = ignore();
ig.add(fs.readFileSync(filePath, "utf8"));
return not(ig.createFilter());
}

//------------------------------------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"eslint": ">=1.10.3 <3.0.0"
},
"dependencies": {
"ignore": "^2.2.19",
"ignore": "^3.0.11",
"minimatch": "^3.0.0",
"object-assign": "^4.0.1",
"resolve": "^1.1.6"
"resolve": "^1.1.7"
},
"devDependencies": {
"coveralls": "^2.11.4",
"eslint": "^2.0.0",
"eslint": "^2.5.1",
"eslint-config-mysticatea": "^2.0.0",
"istanbul": "^0.4.0",
"mocha": "^2.3.4",
Expand Down

0 comments on commit c72f6c6

Please sign in to comment.