mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
🐛 修复一些插件更新和安装问题
This commit is contained in:
parent
c4e259892c
commit
670cd5eb1a
@ -16,6 +16,7 @@ plugins_list: Dict[str, Dict[str, str]] = {}
|
||||
async def update_all_plugins() -> List[str]:
|
||||
log_list = []
|
||||
for plugin in PLUGINS_PATH.iterdir():
|
||||
if plugin.is_dir():
|
||||
log_list.extend(update_from_git(0, plugin))
|
||||
return log_list
|
||||
|
||||
@ -64,7 +65,12 @@ def install_plugins(plugins: Dict[str, str]) -> str:
|
||||
path = PLUGINS_PATH / plugin_name
|
||||
if path.exists():
|
||||
return '该插件已经安装过了!'
|
||||
Repo.clone_from(git_path, path, single_branch=True, depth=1)
|
||||
config = {'single_branch': True, 'depth': 1}
|
||||
|
||||
if plugins['branch'] != 'main':
|
||||
config['branch'] = plugins['branch']
|
||||
|
||||
Repo.clone_from(git_path, path, **config)
|
||||
logger.info(f'插件{plugin_name}安装成功!')
|
||||
return f'插件{plugin_name}安装成功!发送[gs重启]以应用!'
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user