MCPcopy Index your code
hub / github.com/kangax/html-minifier / processDirectory

Function processDirectory

cli.js:250–273  ·  view source on GitHub ↗
(inputDir, outputDir, fileExt)

Source from the content-addressed store, hash-verified

248}
249
250function processDirectory(inputDir, outputDir, fileExt) {
251 fs.readdir(inputDir, function(err, files) {
252 if (err) {
253 fatal('Cannot read directory ' + inputDir + '\n' + err.message);
254 }
255 files.forEach(function(file) {
256 var inputFile = path.join(inputDir, file);
257 var outputFile = path.join(outputDir, file);
258 fs.stat(inputFile, function(err, stat) {
259 if (err) {
260 fatal('Cannot read ' + inputFile + '\n' + err.message);
261 }
262 else if (stat.isDirectory()) {
263 processDirectory(inputFile, outputFile, fileExt);
264 }
265 else if (!fileExt || path.extname(file) === '.' + fileExt) {
266 mkdir(outputDir, function() {
267 processFile(inputFile, outputFile);
268 });
269 }
270 });
271 });
272 });
273}
274
275function writeMinify() {
276 var minified;

Callers 1

cli.jsFile · 0.85

Calls 3

fatalFunction · 0.85
mkdirFunction · 0.85
processFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…