Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit f061feb

Browse files
committed
Fix missing chars in root folder.
1 parent 6e4da24 commit f061feb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/utils/find_files.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
var fs = require('fs-extra');
2-
var os = require('os');
1+
var fs = require('fs-extra');
2+
var klawSync = require('klaw-sync');
3+
var os = require('os');
34

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

@@ -59,7 +60,9 @@ FindFiles.prototype.search = function() {
5960
var self = this;
6061
var files = [];
6162
try {
62-
files = fs.walkSync(self.path);
63+
files = klawSync(self.path).map( function(entry) {
64+
return entry.path;
65+
});
6366

6467
// create RegExp Include Filter List
6568
var regExpIncludeFilters = [];
@@ -136,12 +139,11 @@ FindFiles.prototype.search = function() {
136139
if (self.path !== './') {
137140
files = files.map( function(filename) {
138141
if (filename.startsWith(self.path)) {
139-
return filename.substr(self.path.length);
142+
return filename.substr(self.path.length + 1); // + 1 / at the end
140143
}
141144
return filename;
142145
});
143146
}
144147
}
145-
146148
return files;
147149
};

0 commit comments

Comments
 (0)