Skip to content

Commit 8f90f76

Browse files
authored
Fix the add plugin CLI command config (#1163)
1 parent 49d12f7 commit 8f90f76

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

backend/cli.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ async def install_plugin( # noqa: C901
373373
if repo_url is None:
374374
raise cappa.Exit('前端插件仅允许通过 Git 仓库地址安装', code=1)
375375

376-
frontend_project_root = Prompt.ask('前端项目根路径')
376+
frontend_project_root = Prompt.ask('请输入前端项目根路径')
377377
plugin_name = await install_git_frontend_plugin(repo_url, frontend_project_root)
378378
console.tip(f'前端插件 {plugin_name} 安装成功')
379379
return
@@ -403,7 +403,7 @@ async def install_plugin( # noqa: C901
403403
if not no_sql:
404404
sql_file = await get_plugin_sql(plugin_name, db_type, pk_type)
405405
if sql_file:
406-
console.info(f'正在执行插件 {plugin_name} 初始化 SQL 脚本...')
406+
console.info(f'正在执行插件 {plugin_name} 初始化 SQL 脚本{sql_file}')
407407
async with async_db_session.begin() as db:
408408
await execute_sql_scripts(db, sql_file)
409409
else:
@@ -426,7 +426,7 @@ async def remove() -> None:
426426
if not no_sql:
427427
destroy_sql_file = await get_plugin_destroy_sql(plugin, settings.DATABASE_TYPE, settings.DATABASE_PK_MODE)
428428
if destroy_sql_file:
429-
console.note(f'正在执行插件 {plugin} 销毁 SQL 脚本...')
429+
console.note(f'正在执行插件 {plugin} 销毁 SQL 脚本{destroy_sql_file}')
430430
async with async_db_session.begin() as db:
431431
await execute_destroy_sql_scripts(db, destroy_sql_file)
432432
else:
@@ -687,11 +687,11 @@ class Add:
687687
]
688688
db_type: Annotated[
689689
DataBaseType,
690-
cappa.Arg(default='postgresql', help='执行插件 SQL 脚本的数据库类型'),
690+
cappa.Arg(default=settings.DATABASE_TYPE, help='执行插件 SQL 脚本的数据库类型'),
691691
]
692692
pk_type: Annotated[
693693
PrimaryKeyType,
694-
cappa.Arg(default='autoincrement', help='执行插件 SQL 脚本数据库主键类型'),
694+
cappa.Arg(default=settings.DATABASE_PK_MODE, help='执行插件 SQL 脚本数据库主键类型'),
695695
]
696696

697697
async def __call__(self) -> None:

0 commit comments

Comments
 (0)