mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
✨ 简化安装依赖的命令构建逻辑
This commit is contained in:
parent
922ca71e7d
commit
13b690c23a
@ -20,6 +20,10 @@ from .config import BASE_PATH, DEFAULT_GITHUB_URL, EXTRA_GITHUB_URL
|
|||||||
|
|
||||||
BAT_FILE = Path() / "win启动.bat"
|
BAT_FILE = Path() / "win启动.bat"
|
||||||
|
|
||||||
|
WIN_COMMAND = ["./Python310/python.exe", "-m", "pip", "install", "-r"]
|
||||||
|
|
||||||
|
DEFAULT_COMMAND = ["poetry", "run", "pip", "install", "-r"]
|
||||||
|
|
||||||
|
|
||||||
def row_style(column: str, text: str) -> RowStyle:
|
def row_style(column: str, text: str) -> RowStyle:
|
||||||
"""被动技能文本风格
|
"""被动技能文本风格
|
||||||
@ -52,24 +56,8 @@ def install_requirement(plugin_path: Path):
|
|||||||
return
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if BAT_FILE.exists():
|
command = WIN_COMMAND if BAT_FILE.exists() else DEFAULT_COMMAND
|
||||||
command = [
|
command.append(str(existing_requirements))
|
||||||
"./Python310/python.exe",
|
|
||||||
"-m",
|
|
||||||
"pip",
|
|
||||||
"install",
|
|
||||||
"-r",
|
|
||||||
str(existing_requirements),
|
|
||||||
]
|
|
||||||
else:
|
|
||||||
command = [
|
|
||||||
"poetry",
|
|
||||||
"run",
|
|
||||||
"pip",
|
|
||||||
"install",
|
|
||||||
"-r",
|
|
||||||
str(existing_requirements),
|
|
||||||
]
|
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
command,
|
command,
|
||||||
check=True,
|
check=True,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user