未验证 提交 7e7b66fc 编写于 作者: F Frost Ming

fix: the breakage of completion script after 2.0

Fix #1283
上级 d4a86df1
Fix a bug that completion scripts are interpreted as rich markups.
......@@ -33,4 +33,5 @@ class Command(BaseCommand):
completion = importlib.resources.read_text(
"pdm.cli.completions", f"pdm.{suffix}"
)
project.core.ui.echo(completion.replace("%{python_executable}", sys.executable))
# Can't use rich print or otherwise the rich markups will be interpreted
print(completion.replace("%{python_executable}", sys.executable))
......@@ -281,7 +281,9 @@ class Project:
backend: str = self.config["venv.backend"]
venv_backend = BACKENDS[backend](self, None)
path = venv_backend.create(in_project=self.config["venv.in_project"])
path = venv_backend.create(
force=True, in_project=self.config["venv.in_project"]
)
self.core.ui.echo(
f"Virtualenv is created successfully at [green]{path}[/]", err=True
)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册