mirror of
https://github.com/nitezs/sub2clash.git
synced 2024-12-23 14:14:42 -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:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
branches:
|
||||
- dev
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
|
@ -107,11 +107,11 @@ func BuildSub(query validator.SubQuery, template string) (
|
||||
func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
|
||||
// 只合并节点、策略组
|
||||
// 统计所有国家策略组名称
|
||||
var newCountryGroupNames []string
|
||||
var countryGroupNames []string
|
||||
for _, proxyGroup := range sub.ProxyGroups {
|
||||
if proxyGroup.IsCountryGrop {
|
||||
newCountryGroupNames = append(
|
||||
newCountryGroupNames, proxyGroup.Name,
|
||||
countryGroupNames = append(
|
||||
countryGroupNames, proxyGroup.Name,
|
||||
)
|
||||
}
|
||||
}
|
||||
@ -119,8 +119,7 @@ func MergeSubAndTemplate(temp *model.Subscription, sub *model.Subscription) {
|
||||
temp.Proxies = append(temp.Proxies, sub.Proxies...)
|
||||
// 将订阅中的策略组添加到模板中
|
||||
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.Rules = append(temp.Rules, sub.Rules...)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user