Skip to content

Commit

Permalink
Merge pull request #3 from DreamworldSolutions/master
Browse files Browse the repository at this point in the history
used glob-all instead of glob to solve the sub directory exclusion issue
  • Loading branch information
mac- committed May 24, 2016
2 parents 24f9cea + b84bfc3 commit 6fae4ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
10 changes: 3 additions & 7 deletions lib/hash.js
Expand Up @@ -2,7 +2,7 @@ var fs = require('fs'),
crypto = require('crypto'),
_ = require('underscore'),
async = require('async'),
glob = require('glob'),
glob = require('glob-all'),
validAlgorithms = ['md5', 'sha', 'sha1', 'sha224', 'sha256', 'sha384', 'sha512'];

function hashFiles(options, callback) {
Expand Down Expand Up @@ -39,9 +39,7 @@ function hashFiles(options, callback) {
globFunctions.push(process.nextTick);
}
else {
files.forEach(function(file) {
globFunctions.push(handleGlob(file));
});
globFunctions.push(handleGlob(files));
}
async.parallelLimit(globFunctions, batchCount, function(err, results) {
if (err) {
Expand Down Expand Up @@ -86,9 +84,7 @@ function hashFilesSync(options) {
}

if (!options.noGlob) {
files.forEach(function(file) {
allFiles = allFiles.concat(glob.sync(file, { mark: true }));
});
allFiles = allFiles.concat(glob.sync(files, { mark: true }));
files = allFiles;
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -4,10 +4,10 @@
"contributors": [
"Mac Angell <mac.ang311@gmail.com>"
],
"version": "1.1.0",
"version": "1.1.1",
"dependencies": {
"async": "^1.5.2",
"glob": "^7.0.3",
"glob-all": "^3.0.3",
"opter": "^1.1.0",
"read-files": "^0.1.0",
"underscore": "^1.8.3"
Expand Down

0 comments on commit 6fae4ab

Please sign in to comment.