MCPcopy
hub / github.com/csscomb/csscomb.js / processDirectory

Method processDirectory

src/core.js:158–175  ·  view source on GitHub ↗

* Processes directory recursively. * * @param {String} path * @returns {Promise}

(path)

Source from the content-addressed store, hash-verified

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.

Callers 1

processPathMethod · 0.80

Calls 2

_shouldProcessMethod · 0.80
processFileMethod · 0.80

Tested by

no test coverage detected