Take care not to proceed when user is just setting telemetry
This commit is contained in:
Родитель
54598cc420
Коммит
9697bd75bc
|
@ -770,10 +770,22 @@ export async function main(args: string[] | Partial<CLIOptions>) {
|
|||
cliOptions = inferCLIOptions(args);
|
||||
}
|
||||
|
||||
if (cliOptions.telemetry === "enable") {
|
||||
telemetry.enable();
|
||||
} else if (cliOptions.telemetry === "disable") {
|
||||
telemetry.disable();
|
||||
if (cliOptions.telemetry !== undefined) {
|
||||
switch (cliOptions.telemetry) {
|
||||
case "enable":
|
||||
telemetry.enable();
|
||||
break;
|
||||
case "disable":
|
||||
telemetry.disable();
|
||||
break;
|
||||
default:
|
||||
console.error(chalk.red("telemetry must be 'enable' or 'disable'"));
|
||||
return;
|
||||
}
|
||||
if (Array.isArray(args) && args.length === 2) {
|
||||
// This was merely a CLI run to set telemetry and we should not proceed
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const quicktypeOptions = await makeQuicktypeOptions(cliOptions);
|
||||
|
|
Загрузка…
Ссылка в новой задаче