Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-06-15 01:13:03 +0400
committerisaacs <i@izs.me>2011-06-15 01:13:03 +0400
commitbd38304591043e7045e7a6c521f7de8b2417b461 (patch)
tree488c4243fb01e6c711ab43e2a47b7051dbdc2438
parent9d8ea3f6730a1c08e776e7c61eb45e600624c99a (diff)
Excluding a dir should exclude everything
-rw-r--r--lib/utils/excludes.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/utils/excludes.js b/lib/utils/excludes.js
index 1c1bd40ad..08d186946 100644
--- a/lib/utils/excludes.js
+++ b/lib/utils/excludes.js
@@ -34,6 +34,7 @@ var path = require("path")
// read an ignore file, or fall back to the
// "gitBase" file in the same directory.
function readIgnoreFile (file, gitBase, cb) {
+ //log.warn(file, "ignoreFile")
if (!file) return cb(null, "")
fs.readFile(file, function (er, data) {
if (!er) return cb(null, data || "")
@@ -104,6 +105,9 @@ function test (file, excludeList) {
var ex = excludes[ii].replace(/^\.\//, "")
, inc = ex.match(incRe)
+ // excluding/including a dir excludes/includes all the files in it.
+ if (ex.slice(-1) === "/") ex += "*"
+
// if this is not an inclusion attempt, and someone else
// excluded it, then just continue, because there's nothing
// that can be done here to change the exclusion.
@@ -112,8 +116,10 @@ function test (file, excludeList) {
// if it matches the pattern, then it should be excluded.
excluded = minimatch(rf, ex)
}
+ //log.warn([rf, excluded, excludes], "file, excluded, excludes")
}
// true if it *should* be included
+ // log.warn([file, excludeList, excluded], "file, excluded")
return !excluded
}