mirror of
https://github.com/Redocly/redoc.git
synced 2025-08-08 14:14:56 +03:00
removed redundant variable
This commit is contained in:
parent
2e735d1bff
commit
c0a4bb78e9
12
cli/index.ts
12
cli/index.ts
|
@ -64,14 +64,12 @@ YargsParser.command(
|
|||
return yargs;
|
||||
},
|
||||
async argv => {
|
||||
const redocOptions = getRedocOptions(argv.options);
|
||||
|
||||
const config: Options = {
|
||||
ssr: argv.ssr as boolean,
|
||||
watch: argv.watch as boolean,
|
||||
templateFileName: argv.template as string,
|
||||
templateOptions: argv.templateOptions || {},
|
||||
redocOptions,
|
||||
redocOptions: getObjectOrJSON(argv.options),
|
||||
};
|
||||
|
||||
console.log(config);
|
||||
|
@ -120,8 +118,6 @@ YargsParser.command(
|
|||
return yargs;
|
||||
},
|
||||
async (argv: any) => {
|
||||
const redocOptions = getRedocOptions(argv.options);
|
||||
|
||||
const config = {
|
||||
ssr: true,
|
||||
output: argv.o as string,
|
||||
|
@ -130,7 +126,7 @@ YargsParser.command(
|
|||
disableGoogleFont: argv.disableGoogleFont as boolean,
|
||||
templateFileName: argv.template as string,
|
||||
templateOptions: argv.templateOptions || {},
|
||||
redocOptions,
|
||||
redocOptions: getObjectOrJSON(argv.options),
|
||||
};
|
||||
|
||||
try {
|
||||
|
@ -360,9 +356,9 @@ function handleError(error: Error) {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
function getRedocOptions(options) {
|
||||
function getObjectOrJSON(options) {
|
||||
return options && typeof options === 'string'
|
||||
? JSON.parse(options) : options
|
||||
? options
|
||||
: {};
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user