Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function run(name) {
const keys = Object.keys(registry);
const promise = Promise.resolve();
if (keys.length === 0) {
return promise;
}
name = name || options._.shift() || 'default';
const task = registry[name];
if (!task) {
console.log(columns(keys));
return promise;
}
const done = time(name, options);
return promise.then(() => task(options, subtasks)).then(done);
}