From 76e13570a2a112f0453f2560d4b9de06d440bdc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=96=E7=95=8C?= Date: Sun, 12 May 2024 00:31:19 +0800 Subject: [PATCH] Add `.` --- option/template.go | 2 ++ template/render_geo_resources.go | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/option/template.go b/option/template.go index 7c4ba1b..863a230 100644 --- a/option/template.go +++ b/option/template.go @@ -116,6 +116,8 @@ type GitHubRuleSetOptions struct { Owner string `json:"owner,omitempty"` Repo string `json:"repo,omitempty"` Branch string `json:"branch,omitempty"` + Path string `json:"path,omitempty"` + Prefix string `json:"prefix,omitempty"` RuleSet option.Listable[string] `json:"rule_set,omitempty"` } diff --git a/template/render_geo_resources.go b/template/render_geo_resources.go index 05914c0..a53d2c7 100644 --- a/template/render_geo_resources.go +++ b/template/render_geo_resources.go @@ -120,14 +120,15 @@ func (t *Template) renderRuleSet(ruleSets []option.RuleSet) []boxOption.RuleSet for _, code := range ruleSet.GitHubOptions.RuleSet { result = append(result, boxOption.RuleSet{ Type: C.RuleSetTypeRemote, - Tag: code, + Tag: ruleSet.GitHubOptions.Prefix + code, Format: C.RuleSetFormatBinary, RemoteOptions: boxOption.RemoteRuleSet{ URL: downloadURL + ruleSet.GitHubOptions.Owner + "/" + - ruleSet.GitHubOptions.Repo + "/" + + ruleSet.GitHubOptions.Repo + branchSplit + ruleSet.GitHubOptions.Branch + "/" + + ruleSet.GitHubOptions.Path + code + ".srs", DownloadDetour: downloadDetour, },