mirror of
https://github.com/Genshin-bots/gsuid_core.git
synced 2025-05-12 06:55:49 +08:00
👽️ 移除安装插件自动转换代理git的行为
This commit is contained in:
parent
65a6173353
commit
b64190daeb
@ -140,7 +140,6 @@ def main():
|
||||
plugin = plugins_list[name]
|
||||
link = plugin['link']
|
||||
plugin_name = link.split('/')[-1]
|
||||
# git_path = f'{proxy_url}{link}.git'
|
||||
sample = {
|
||||
'label': plugin_name,
|
||||
'key': name,
|
||||
|
@ -61,4 +61,5 @@ CONIFG_DEFAULT: Dict[str, GSC] = {
|
||||
'AutoUpdateDep': GsBoolConfig('自动更新依赖', '更新插件时将会自动更新依赖', False),
|
||||
'EnablePicSrv': GsBoolConfig('将图片转链接发送(需公网)', '发送图片转链接', False),
|
||||
'PicSrv': GsStrConfig('将图片转链接发送(需公网)', '发送图片转链接', ''),
|
||||
'ProxyURL': GsStrConfig('安装插件时使用git代理地址', 'git代理地址', ''),
|
||||
}
|
||||
|
@ -11,11 +11,12 @@ from git.exc import GitCommandError, NoSuchPathError, InvalidGitRepositoryError
|
||||
from gsuid_core.logger import logger
|
||||
from gsuid_core.utils.plugins_config.gs_config import core_plugins_config
|
||||
|
||||
from .api import CORE_PATH, PLUGINS_PATH, proxy_url, plugins_lib
|
||||
from .api import CORE_PATH, PLUGINS_PATH, plugins_lib
|
||||
|
||||
plugins_list: Dict[str, Dict[str, str]] = {}
|
||||
|
||||
is_update_dep = core_plugins_config.get_config('AutoUpdateDep').data
|
||||
proxy_url: str = core_plugins_config.get_config('ProxyURL').data
|
||||
|
||||
|
||||
# 传入一个path对象
|
||||
@ -115,7 +116,11 @@ async def get_plugins_url(name: str) -> Optional[Dict[str, str]]:
|
||||
|
||||
def install_plugins(plugins: Dict[str, str]) -> str:
|
||||
plugin_name = plugins['link'].split('/')[-1]
|
||||
git_path = f'{proxy_url}{plugins["link"]}.git'
|
||||
if proxy_url and not proxy_url.endswith('/'):
|
||||
_proxy_url = proxy_url + '/'
|
||||
else:
|
||||
_proxy_url = proxy_url
|
||||
git_path = f'{_proxy_url}{plugins["link"]}.git'
|
||||
logger.info(f'稍等...开始安装插件, 地址: {git_path}')
|
||||
path = PLUGINS_PATH / plugin_name
|
||||
if path.exists():
|
||||
|
@ -1,11 +1,6 @@
|
||||
from pathlib import Path
|
||||
|
||||
# raw_url = 'https://raw.githubusercontent.com'
|
||||
# repo_title = 'Genshin-bots/GenshinUID-docs/master/docs'
|
||||
# plugins_lib = f'{raw_url}/{repo_title}/PluginsList.md'
|
||||
plugins_lib = 'https://docs.sayu-bot.com/plugin_list.json'
|
||||
|
||||
proxy_url = 'https://ghproxy.com/'
|
||||
|
||||
PLUGINS_PATH = Path(__file__).parents[2] / 'plugins'
|
||||
CORE_PATH = Path(__file__).parents[3]
|
||||
|
Loading…
x
Reference in New Issue
Block a user