mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-24 11:14:41 -05:00
mod
This commit is contained in:
parent
0f2dba21eb
commit
f6273947e7
4
.github/workflows/docker.yml
vendored
4
.github/workflows/docker.yml
vendored
@ -2,8 +2,8 @@ name: Build and Push to GHCR
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
tags:
|
branches:
|
||||||
- '*'
|
- dev
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
@ -107,11 +107,11 @@ func BuildSub(query validator.SubQuery, template string) (
|
|||||||
func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
|
func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
|
||||||
// 只合并节点、策略组
|
// 只合并节点、策略组
|
||||||
// 统计所有国家策略组名称
|
// 统计所有国家策略组名称
|
||||||
var newCountryGroupNames []string
|
var countryGroupNames []string
|
||||||
for _, proxyGroup := range sub.ProxyGroups {
|
for _, proxyGroup := range sub.ProxyGroups {
|
||||||
if proxyGroup.IsCountryGrop {
|
if proxyGroup.IsCountryGrop {
|
||||||
newCountryGroupNames = append(
|
countryGroupNames = append(
|
||||||
newCountryGroupNames, proxyGroup.Name,
|
countryGroupNames, proxyGroup.Name,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -119,8 +119,7 @@ func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
|
|||||||
temp.Proxies = append(temp.Proxies, sub.Proxies...)
|
temp.Proxies = append(temp.Proxies, sub.Proxies...)
|
||||||
// 将订阅中的策略组添加到模板中
|
// 将订阅中的策略组添加到模板中
|
||||||
for i := range temp.ProxyGroups {
|
for i := range temp.ProxyGroups {
|
||||||
temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, newCountryGroupNames...)
|
temp.ProxyGroups[i].Proxies = append(temp.ProxyGroups[i].Proxies, countryGroupNames...)
|
||||||
}
|
}
|
||||||
temp.ProxyGroups = append(temp.ProxyGroups, sub.ProxyGroups...)
|
temp.ProxyGroups = append(temp.ProxyGroups, sub.ProxyGroups...)
|
||||||
temp.Rules = append(temp.Rules, sub.Rules...)
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user