mirror of
https://github.com/wnlen/clash-for-linux.git
synced 2026-10-10 04:03:04 +08:00
Allow disabling GitHub download mirrors (#320)
This commit is contained in:
@@ -410,6 +410,13 @@ github_proxy_prefix() {
|
||||
echo "$prefix"
|
||||
}
|
||||
|
||||
github_mirror_enabled() {
|
||||
case "${CLASH_GH_PROXY_ENABLED:-true}" in
|
||||
false|0|no|off) return 1 ;;
|
||||
*) return 0 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
bundled_asset_enabled() {
|
||||
case "${CLASH_BUNDLED_ASSET_ENABLED:-true}" in
|
||||
true|1|yes|on) return 0 ;;
|
||||
@@ -760,6 +767,11 @@ github_mirror_candidate_entries() {
|
||||
return 0
|
||||
}
|
||||
|
||||
if ! github_mirror_enabled; then
|
||||
echo "origin||origin"
|
||||
return 0
|
||||
fi
|
||||
|
||||
if [ -n "$(github_proxy_prefix)" ]; then
|
||||
entry="custom|$(github_proxy_prefix)|full"
|
||||
normalized="$(normalize_github_mirror_entry "$entry" 2>/dev/null || true)"
|
||||
|
||||
Reference in New Issue
Block a user