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

Commit feb72bc

Browse files
committed
fix: set default reporter for command 'update'
1 parent fefd44f commit feb72bc

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

lib/cli/index.js

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -97,17 +97,9 @@ function runGemini(method, paths, options) {
9797
return gemini;
9898
})
9999
.then((gemini) => {
100-
function parseReporterOptions(options) {
101-
return options.reporter.map(function(name) {
102-
return {
103-
name,
104-
path: options[`${name}ReporterPath`]
105-
};
106-
});
107-
}
108100
return gemini[method](paths, {
109101
sets: options.set,
110-
reporters: parseReporterOptions(options) || [{name: 'flat'}],
102+
reporters: parseReporterOptions(options),
111103
grep: program.grep,
112104
browsers: program.browser,
113105
diff: options.diff,
@@ -124,6 +116,19 @@ function runGemini(method, paths, options) {
124116
.then(exit);
125117
}
126118

119+
function parseReporterOptions(options) {
120+
if (!options.reporter) {
121+
return [{name: 'flat'}];
122+
}
123+
124+
return options.reporter.map(function(name) {
125+
return {
126+
name,
127+
path: options[`${name}ReporterPath`]
128+
};
129+
});
130+
}
131+
127132
function exit(code) {
128133
process.on('exit', () => process.exit(exitCode || code));
129134
}

0 commit comments

Comments
 (0)