Skip to content

Commit 47bfb89

Browse files
committed
✨ change dependency update strategy and allow to complete missing dependencies
1 parent 68ca89d commit 47bfb89

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

nb_cli/cli/commands/project.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,13 @@ async def upgrade_format():
574574
await upgrade_project_format()
575575
click.echo(_("Successfully upgraded project format."))
576576

577+
if await ConfirmPrompt(
578+
_("Do you want to install missing dependencies?"), True
579+
).prompt_async(style=CLI_DEFAULT_STYLE):
580+
manager = await EnvironmentExecutor.get(cwd=get_project_root())
581+
await manager.lock()
582+
await manager.sync()
583+
577584

578585
@click.command(
579586
cls=ClickAliasedCommand, help=_("Downgrade the project format of your bot.")

nb_cli/handlers/project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ async def upgrade_project_format(*, cwd: Path | None = None) -> None:
176176

177177
manager = get_config_manager(cwd)
178178
manager.update_nonebot_config(new_config)
179-
manager.update_dependency(nonebot_pkg, *packages)
179+
manager.add_dependency(nonebot_pkg, *packages)
180180

181181

182182
@requires_project_root

0 commit comments

Comments
 (0)