Skip to content

Commit e7c543f

Browse files
committed
feat 第三方插件支持依赖
1 parent 2a61720 commit e7c543f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/helper/plugin.py

+4
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,8 @@ def __download_files(_p: str, _l: List[dict]) -> Tuple[bool, str]:
120120
shutil.rmtree(plugin_dir, ignore_errors=True)
121121
# 下载所有文件
122122
__download_files(pid.lower(), file_list)
123+
# 插件目录下如有requirements.txt则安装依赖
124+
requirements_file = plugin_dir / "requirements.txt"
125+
if requirements_file.exists():
126+
SystemUtils.execute(f"pip install -r {requirements_file}")
123127
return True, ""

0 commit comments

Comments
 (0)