mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
refactor(cli): remove official connectors inquiry
This commit is contained in:
parent
95ef24a92b
commit
bf3774d234
3 changed files with 3 additions and 30 deletions
|
@ -4,13 +4,12 @@
|
||||||
"commit": false,
|
"commit": false,
|
||||||
"//": "CAUTION: When updating the fields below, you should also update README accordingly.",
|
"//": "CAUTION: When updating the fields below, you should also update README accordingly.",
|
||||||
"fixed": [[
|
"fixed": [[
|
||||||
"@logto/cli",
|
|
||||||
"@logto/create"
|
|
||||||
], [
|
|
||||||
"@logto/core",
|
"@logto/core",
|
||||||
"@logto/console",
|
"@logto/console",
|
||||||
"@logto/integration-tests",
|
"@logto/integration-tests",
|
||||||
"@logto/ui"
|
"@logto/ui",
|
||||||
|
"@logto/cli",
|
||||||
|
"@logto/create"
|
||||||
]],
|
]],
|
||||||
"linked": [[
|
"linked": [[
|
||||||
"@logto/schemas",
|
"@logto/schemas",
|
||||||
|
|
|
@ -3,7 +3,6 @@ import type { CommandModule } from 'yargs';
|
||||||
|
|
||||||
import { getDatabaseUrlFromConfig } from '../../database.js';
|
import { getDatabaseUrlFromConfig } from '../../database.js';
|
||||||
import { log } from '../../utilities.js';
|
import { log } from '../../utilities.js';
|
||||||
import { addOfficialConnectors } from '../connector/utils.js';
|
|
||||||
import {
|
import {
|
||||||
validateNodeVersion,
|
validateNodeVersion,
|
||||||
inquireInstancePath,
|
inquireInstancePath,
|
||||||
|
@ -13,7 +12,6 @@ import {
|
||||||
createEnv,
|
createEnv,
|
||||||
logFinale,
|
logFinale,
|
||||||
decompress,
|
decompress,
|
||||||
inquireOfficialConnectors,
|
|
||||||
isUrl,
|
isUrl,
|
||||||
} from './utils.js';
|
} from './utils.js';
|
||||||
|
|
||||||
|
@ -52,16 +50,6 @@ const installLogto = async ({ path, skipSeed, officialConnectors, downloadUrl }:
|
||||||
// Save to dot env
|
// Save to dot env
|
||||||
await createEnv(instancePath, await getDatabaseUrlFromConfig());
|
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
|
// Finale
|
||||||
logFinale(instancePath);
|
logFinale(instancePath);
|
||||||
};
|
};
|
||||||
|
|
|
@ -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) => {
|
export const isUrl = (string: string) => {
|
||||||
try {
|
try {
|
||||||
// On purpose to test
|
// On purpose to test
|
||||||
|
|
Loading…
Reference in a new issue