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

Commit

Permalink
Remove async-foreach dependency
Browse files Browse the repository at this point in the history
Fixes #2487
  • Loading branch information
xzyfer committed Mar 21, 2020
1 parent 516ca36 commit 895acbd
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"env": {
"es6": true,
"node": true
},
"globals": {},
Expand Down
26 changes: 13 additions & 13 deletions bin/node-sass
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

var Emitter = require('events').EventEmitter,
forEach = require('async-foreach').forEach,
promisify = require('util').promisify,
chokidar = require('chokidar'),
meow = require('meow'),
util = require('util'),
Expand Down Expand Up @@ -410,19 +410,19 @@ function renderDir(options, emitter, done) {
return emitter.emit('error', 'No input file was found.');
}

forEach(files, function(subject) {
renderFile(subject, options, emitter, this.async());
}, function(successful, arr) {
var outputDir = path.join(process.cwd(), options.output);
if (!options.quiet) {
emitter.emit('info', util.format('Wrote %s CSS files to %s', arr.length, outputDir));
}
if (successful) {
done();
} else {
Promise.all(files.map(function(subject) {
return promisify(renderFile)(subject, options, emitter);
}))
.then(function(res) {
var outputDir = path.join(process.cwd(), options.output);
if (!options.quiet) {
emitter.emit('info', util.format('Wrote %s CSS files to %s', res.length, outputDir));
}
})
.then(done)
.catch(function() {
done(new Error('Some files failed to compile'));
}
});
});
});
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
"style"
],
"dependencies": {
"async-foreach": "^0.1.3",
"chalk": "^2.4.2",
"chokidar": "^3.3.0",
"cross-spawn": "^7.0.1",
Expand Down

0 comments on commit 895acbd

Please sign in to comment.