Skip to content

Commit

Permalink
Fixed #6
Browse files Browse the repository at this point in the history
  • Loading branch information
Sv443 committed Jan 21, 2021
1 parent 63de7ce commit 757d484
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/classes/FolderDaemon.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,21 @@ class FolderDaemon
}

files.forEach(file => {
this._blacklistPattern.forEach(pattern => {
let match = minimatch(basename(file), pattern);
if(match)
return;
let filePath = !this._recursive ? join(this._dirPath, file) : file;

let filePath = !this._recursive ? join(this._dirPath, file) : file;
if(Array.isArray(this._blacklistPattern) && this._blacklistPattern.length > 0)
{
this._blacklistPattern.forEach(pattern => {
let match = minimatch(basename(file), pattern);
if(match)
return;

promises.push(hashFile(filePath));
return;
});
}
else
promises.push(hashFile(filePath));
});
});

Promise.all(promises).then(results => {
Expand Down

0 comments on commit 757d484

Please sign in to comment.