Skip to content

Commit

Permalink
Fix missing chars in root folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
rottmann committed Jan 23, 2017
1 parent 6e4da24 commit f061feb
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/utils/find_files.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
var fs = require('fs-extra');
var os = require('os');
var fs = require('fs-extra');
var klawSync = require('klaw-sync');
var os = require('os');

var FileError = require('../errors/file_error');

Expand Down Expand Up @@ -59,7 +60,9 @@ FindFiles.prototype.search = function() {
var self = this;
var files = [];
try {
files = fs.walkSync(self.path);
files = klawSync(self.path).map( function(entry) {
return entry.path;
});

// create RegExp Include Filter List
var regExpIncludeFilters = [];
Expand Down Expand Up @@ -136,12 +139,11 @@ FindFiles.prototype.search = function() {
if (self.path !== './') {
files = files.map( function(filename) {
if (filename.startsWith(self.path)) {
return filename.substr(self.path.length);
return filename.substr(self.path.length + 1); // + 1 / at the end
}
return filename;
});
}
}

return files;
};

0 comments on commit f061feb

Please sign in to comment.