bower-files
Advanced tools
Comparing version 3.7.2 to 3.8.0
@@ -24,3 +24,4 @@ 'use strict'; | ||
join: {}, | ||
camelCase: this.bowerFiles._config.camelCase | ||
camelCase: this.bowerFiles._config.camelCase, | ||
cwd: this.bowerFiles._config.cwd | ||
}, options || {}); | ||
@@ -146,3 +147,3 @@ } | ||
var files = deps[depName]; | ||
files = patternMatch(files, self.options.match); | ||
files = patternMatch(files, self.options.match, self.options.cwd); | ||
files = extensionSplit(files, self.options.ext, self.options.join); | ||
@@ -161,3 +162,3 @@ finalDeps[depName] = files; | ||
// use match option | ||
files = patternMatch(files, self.options.match); | ||
files = patternMatch(files, self.options.match, self.options.cwd); | ||
// Use ext option | ||
@@ -179,7 +180,12 @@ // If it's an array and it has a length greater than 1 | ||
function patternMatch(files, patterns) { | ||
function patternMatch(files, patterns, cwd) { | ||
files = files.map(function (file) { | ||
return file.replace(cwd + path.sep, ''); | ||
}); | ||
patterns.forEach(function (pattern) { | ||
files = files.filter(minimatch.filter(pattern)); | ||
}); | ||
return files; | ||
return files.map(function (file) { | ||
return path.join(cwd, file); | ||
}); | ||
} | ||
@@ -186,0 +192,0 @@ |
{ | ||
"name": "bower-files", | ||
"version": "3.7.2", | ||
"version": "3.8.0", | ||
"main": "./lib/bower-files", | ||
@@ -19,3 +19,3 @@ "description": "Pulls in dynamic list of filepaths to bower components", | ||
"posttest": " npm run check-cov; npm run jshint;", | ||
"codeclimate": "cat ./coverage/lcov.info | codeclimate" | ||
"codeclimate": "cat ./coverage/lcov.info | codeclimate-test-reporter" | ||
}, | ||
@@ -22,0 +22,0 @@ "repository": { |
@@ -315,3 +315,3 @@ # bower-files | ||
css: ['/path/to/bootstrap.css'], | ||
less: ['/path/to/boostrap.less'], | ||
less: ['/path/to/bootstrap.less'], | ||
you get the picture... | ||
@@ -328,2 +328,5 @@ } | ||
The matches are done relative to process.cwd(). So if you wanted to get all of | ||
the bootstrap files by matching, you would use `'*/bootstrap/**'` as a pattern. | ||
```javascript | ||
@@ -330,0 +333,0 @@ // Gets all .js files that aren't .min.js files |
26730
11
403
398