Skip to content

Commit

Permalink
Add <rule-set>.<type=github/path/prefix>
Browse files Browse the repository at this point in the history
  • Loading branch information
nekohasekai committed May 11, 2024
1 parent 962bc9c commit 76e1357
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions option/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
}

Expand Down
5 changes: 3 additions & 2 deletions template/render_geo_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit 76e1357

Please sign in to comment.