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