From 12ce8fbc3ac8fa938e9a60111a15dac26ef72583 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 20 Feb 2019 12:19:52 -0800 Subject: [PATCH] bin: refactor citgm-all Replace lodash _reduce() with Array.prototype.map(). Remove unused argument to launch(). --- bin/citgm-all.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/bin/citgm-all.js b/bin/citgm-all.js index 91b19ec98..54339886f 100755 --- a/bin/citgm-all.js +++ b/bin/citgm-all.js @@ -3,7 +3,6 @@ const os = require('os'); -const _ = require('lodash'); const async = require('async'); const checkTags = require('../lib/check-tags'); @@ -113,10 +112,10 @@ if (!citgm.windows) { uidnumber(uid, gid, (err, uid, gid) => { options.uid = uid; options.gid = gid; - launch(options); + launch(); }); } else { - launch(options); + launch(); } const modules = []; @@ -194,16 +193,12 @@ function runTask(task, next) { runCitgm(task.mod, task.name, next); } -function filterLookup(result, value, key) { - result.push({ - name: key, - mod: value - }); - return result; +function mapCallback(name) { + return { name: name, mod: lookup[name] }; } function launch() { - const collection = _.reduce(lookup, filterLookup, []); + const collection = Object.keys(lookup).map(mapCallback); const q = async.queue(runTask, app.parallel || 1); q.push(collection);