mirror of
https://github.com/LiteyukiStudio/LiteyukiBot.git
synced 2024-11-26 14:05:03 +08:00
feat: 提供插件更新功能
This commit is contained in:
parent
e0dc840197
commit
23353a3673
@ -427,9 +427,10 @@ def npm_install(plugin_package_name) -> tuple[bool, str]:
|
|||||||
plugin_package_name:
|
plugin_package_name:
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
tuple[bool, str]:
|
tuple[bool, str]: 是否成功,输出信息
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
# 重定向标准输出
|
||||||
buffer = StringIO()
|
buffer = StringIO()
|
||||||
sys.stdout = buffer
|
sys.stdout = buffer
|
||||||
sys.stderr = buffer
|
sys.stderr = buffer
|
||||||
@ -456,9 +457,8 @@ def npm_install(plugin_package_name) -> tuple[bool, str]:
|
|||||||
if success:
|
if success:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
nonebot.logger.warning(f"npm_install failed, try next mirror.")
|
nonebot.logger.warning(f"pip install failed, try next mirror.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
|
|
||||||
success = False
|
success = False
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user