Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
fix: set default reporter for command 'update'
Browse files Browse the repository at this point in the history
  • Loading branch information
eGavr committed Dec 22, 2016
1 parent fefd44f commit feb72bc
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions lib/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,9 @@ function runGemini(method, paths, options) {
return gemini;
})
.then((gemini) => {
function parseReporterOptions(options) {
return options.reporter.map(function(name) {
return {
name,
path: options[`${name}ReporterPath`]
};
});
}
return gemini[method](paths, {
sets: options.set,
reporters: parseReporterOptions(options) || [{name: 'flat'}],
reporters: parseReporterOptions(options),
grep: program.grep,
browsers: program.browser,
diff: options.diff,
Expand All @@ -124,6 +116,19 @@ function runGemini(method, paths, options) {
.then(exit);
}

function parseReporterOptions(options) {
if (!options.reporter) {
return [{name: 'flat'}];
}

return options.reporter.map(function(name) {
return {
name,
path: options[`${name}ReporterPath`]
};
});
}

function exit(code) {
process.on('exit', () => process.exit(exitCode || code));
}

0 comments on commit feb72bc

Please sign in to comment.