* Processes directory recursively. * * @param {String} path * @returns {Promise}
(path)
| 156 | * @returns {Promise} |
| 157 | */ |
| 158 | processDirectory(path) { |
| 159 | let that = this; |
| 160 | |
| 161 | return vfs.listDir(path).then(function(filenames) { |
| 162 | return vow.all(filenames.map(function(filename) { |
| 163 | let fullname = path + '/' + filename; |
| 164 | return vfs.stat(fullname).then(function(stat) { |
| 165 | if (stat.isDirectory() && that._shouldProcess(fullname)) { |
| 166 | return that.processDirectory(fullname); |
| 167 | } else { |
| 168 | return that.processFile(fullname); |
| 169 | } |
| 170 | }); |
| 171 | })).then(function(results) { |
| 172 | return [].concat.apply([], results); |
| 173 | }); |
| 174 | }); |
| 175 | } |
| 176 | |
| 177 | /** |
| 178 | * Processes single file. |
no test coverage detected