mirror of
https://github.com/logto-io/logto.git
synced 2024-12-16 20:26:19 -05:00
Merge pull request #2062 from logto-io/gao-log-4324-cli-refactor-per-review
refactor(cli): per review
This commit is contained in:
commit
ec1c292246
3 changed files with 8 additions and 9 deletions
|
@ -7,8 +7,7 @@
|
|||
"license": "MPL-2.0",
|
||||
"main": "lib/index.js",
|
||||
"bin": {
|
||||
"logto": "bin/logto",
|
||||
"lg": "bin/logto"
|
||||
"logto": "bin/logto"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
|
|
|
@ -27,8 +27,8 @@ const validateKeys: ValidateKeysFunction = (keys) => {
|
|||
}
|
||||
};
|
||||
|
||||
export const getKey: CommandModule<unknown, { key: string; keys: string[] }> = {
|
||||
command: 'get-key <key> [keys...]',
|
||||
export const getConfig: CommandModule<unknown, { key: string; keys: string[] }> = {
|
||||
command: 'get-config <key> [keys...]',
|
||||
describe: 'Get config value(s) of the given key(s) in Logto database',
|
||||
builder: (yargs) =>
|
||||
yargs
|
||||
|
@ -67,8 +67,8 @@ export const getKey: CommandModule<unknown, { key: string; keys: string[] }> = {
|
|||
},
|
||||
};
|
||||
|
||||
export const setKey: CommandModule<unknown, { key: string; value: string }> = {
|
||||
command: 'set-key <key> <value>',
|
||||
export const setConfig: CommandModule<unknown, { key: string; value: string }> = {
|
||||
command: 'set-config <key> <value>',
|
||||
describe: 'Set config value of the given key in Logto database',
|
||||
builder: (yargs) =>
|
||||
yargs
|
|
@ -2,7 +2,7 @@ import { CommandModule } from 'yargs';
|
|||
|
||||
import { noop } from '../../utilities';
|
||||
import alteration from './alteration';
|
||||
import { getKey, setKey } from './key';
|
||||
import { getConfig, setConfig } from './config';
|
||||
import seed from './seed';
|
||||
import { getUrl, setUrl } from './url';
|
||||
|
||||
|
@ -13,8 +13,8 @@ const database: CommandModule = {
|
|||
yargs
|
||||
.command(getUrl)
|
||||
.command(setUrl)
|
||||
.command(getKey)
|
||||
.command(setKey)
|
||||
.command(getConfig)
|
||||
.command(setConfig)
|
||||
.command(seed)
|
||||
.command(alteration)
|
||||
.demandCommand(1),
|
||||
|
|
Loading…
Reference in a new issue