0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-16 20:26:19 -05:00

refactor(cli): remove official connectors inquiry

This commit is contained in:
Gao Sun 2022-12-30 13:19:27 +08:00
parent 95ef24a92b
commit bf3774d234
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
3 changed files with 3 additions and 30 deletions

View file

@ -4,13 +4,12 @@
"commit": false,
"//": "CAUTION: When updating the fields below, you should also update README accordingly.",
"fixed": [[
"@logto/cli",
"@logto/create"
], [
"@logto/core",
"@logto/console",
"@logto/integration-tests",
"@logto/ui"
"@logto/ui",
"@logto/cli",
"@logto/create"
]],
"linked": [[
"@logto/schemas",

View file

@ -3,7 +3,6 @@ import type { CommandModule } from 'yargs';
import { getDatabaseUrlFromConfig } from '../../database.js';
import { log } from '../../utilities.js';
import { addOfficialConnectors } from '../connector/utils.js';
import {
validateNodeVersion,
inquireInstancePath,
@ -13,7 +12,6 @@ import {
createEnv,
logFinale,
decompress,
inquireOfficialConnectors,
isUrl,
} from './utils.js';
@ -52,16 +50,6 @@ const installLogto = async ({ path, skipSeed, officialConnectors, downloadUrl }:
// Save to dot env
await createEnv(instancePath, await getDatabaseUrlFromConfig());
// Add official connectors
if (await inquireOfficialConnectors(officialConnectors)) {
await addOfficialConnectors(instancePath);
} else {
log.info(
'Skipped adding official connectors.\n\n' +
` You can use the ${chalk.green('connector add')} command to add connectors at any time.\n`
);
}
// Finale
logFinale(instancePath);
};

View file

@ -166,20 +166,6 @@ export const logFinale = (instancePath: string) => {
);
};
export const inquireOfficialConnectors = async (initialAnswer?: boolean) => {
const { value } = await inquirer.prompt<{ value: boolean }>(
{
name: 'value',
message: 'Do you want to add official connectors?',
type: 'confirm',
default: true,
},
{ value: initialAnswer }
);
return value;
};
export const isUrl = (string: string) => {
try {
// On purpose to test