Skip to content

Commit c238edd

Browse files
author
Delta-Kronecker
committed
Add Custom and Custom Batch sections to README summary
1 parent f21cb2c commit c238edd

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

src/writer.go

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1629,6 +1629,39 @@ func writeSummary(results []configResult, failedLinks []string, duration float64
16291629
gen.WriteString(autoGenMarker)
16301630
gen.WriteString("\n")
16311631

1632+
fargSupported := map[string]bool{"vless": true, "trojan": true, "vmess": true, "ss": true}
1633+
fargCount := 0
1634+
for _, r := range results {
1635+
if fargSupported[r.proto] {
1636+
fargCount++
1637+
}
1638+
}
1639+
1640+
// ── 0. Custom Batches ───────────────────────────────────────────────────────
1641+
customBatches := countBatchFiles("config/farg/batches")
1642+
if customBatches > 0 {
1643+
gen.WriteString("## Custom Batch\n\n")
1644+
for i := 1; i <= customBatches; i++ {
1645+
cnt := min500(i, fargCount)
1646+
fmt.Fprintf(&gen, "Custom Batch %03d (%d config):\n```\n%s/config/farg/batches/batch_%03d.json\n```\n\n",
1647+
i, cnt, repoBase, i)
1648+
}
1649+
}
1650+
1651+
// ── 0. Custom ───────────────────────────────────────────────────────────────
1652+
if fargCount > 0 {
1653+
gen.WriteString("## Custom\n\n")
1654+
fmt.Fprintf(&gen, "Custom All (%d config):\n```\n%s/config/farg/all_configs.json\n```\n\n", fargCount, repoBase)
1655+
for _, p := range cfg.ProtocolOrder {
1656+
if fargSupported[p] {
1657+
if n := byProtoOut[p]; n > 0 {
1658+
fmt.Fprintf(&gen, "Custom %s (%d config):\n```\n%s/config/farg/protocols/%s.json\n```\n\n",
1659+
strings.ToUpper(p), n, repoBase, p)
1660+
}
1661+
}
1662+
}
1663+
}
1664+
16321665
// ── 1. V2ray ────────────────────────────────────────────────────────────────
16331666
gen.WriteString("## V2ray\n\n")
16341667
fmt.Fprintf(&gen, "V2ray All (%d config):\n```\n%s/config/all_configs.txt\n```\n\n", len(results), repoBase)

0 commit comments

Comments
 (0)