core: 将 github 代理放到文件头部

This commit is contained in:
bin456789
2023-11-28 22:24:44 +08:00
parent 0516250f76
commit 426b54a2d0
2 changed files with 10 additions and 7 deletions

View File

@ -1,6 +1,7 @@
@echo off
set confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
setlocal EnableDelayedExpansion
set confhome=https://raw.githubusercontent.com/bin456789/reinstall/main
set github_proxy=https://ghps.cc
:: Windows 7 SP1 winhttp 默认不支持 tls 1.2
:: https://support.microsoft.com/en-us/topic/update-to-enable-tls-1-1-and-tls-1-2-as-default-secure-protocols-in-winhttp-in-windows-c4bd73d2-31d7-761e-0178-11268bb10392
@ -31,9 +32,11 @@ if !errorlevel! == 0 (
:: mirrors.tuna.tsinghua.edu.cn 会强制跳转 https
set mirror=http://mirror.nju.edu.cn
echo !confhome! | findstr /c:"://raw.githubusercontent.com/" >nul
if !errorlevel! == 0 (
set confhome=https://ghps.cc/!confhome!
if defined github_proxy (
echo !confhome! | findstr /c:"://raw.githubusercontent.com/" >nul
if !errorlevel! == 0 (
set confhome=!github_proxy!/!confhome!
)
)
) else (
:: mirrors.kernel.org 在荷兰太慢