Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit 895acbd

Browse files
committed
Remove async-foreach dependency
Fixes #2487
1 parent 516ca36 commit 895acbd

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"env": {
3+
"es6": true,
34
"node": true
45
},
56
"globals": {},

bin/node-sass

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env node
22

33
var Emitter = require('events').EventEmitter,
4-
forEach = require('async-foreach').forEach,
4+
promisify = require('util').promisify,
55
chokidar = require('chokidar'),
66
meow = require('meow'),
77
util = require('util'),
@@ -410,19 +410,19 @@ function renderDir(options, emitter, done) {
410410
return emitter.emit('error', 'No input file was found.');
411411
}
412412

413-
forEach(files, function(subject) {
414-
renderFile(subject, options, emitter, this.async());
415-
}, function(successful, arr) {
416-
var outputDir = path.join(process.cwd(), options.output);
417-
if (!options.quiet) {
418-
emitter.emit('info', util.format('Wrote %s CSS files to %s', arr.length, outputDir));
419-
}
420-
if (successful) {
421-
done();
422-
} else {
413+
Promise.all(files.map(function(subject) {
414+
return promisify(renderFile)(subject, options, emitter);
415+
}))
416+
.then(function(res) {
417+
var outputDir = path.join(process.cwd(), options.output);
418+
if (!options.quiet) {
419+
emitter.emit('info', util.format('Wrote %s CSS files to %s', res.length, outputDir));
420+
}
421+
})
422+
.then(done)
423+
.catch(function() {
423424
done(new Error('Some files failed to compile'));
424-
}
425-
});
425+
});
426426
});
427427
}
428428

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@
5353
"style"
5454
],
5555
"dependencies": {
56-
"async-foreach": "^0.1.3",
5756
"chalk": "^2.4.2",
5857
"chokidar": "^3.3.0",
5958
"cross-spawn": "^7.0.1",

0 commit comments

Comments
 (0)