mirror of
https://github.com/v2fly/domain-list-community.git
synced 2026-09-05 02:14:46 +03:00
Fix panic and rule loss in list parsing/resolution (#3905)
* Fix panic on empty inclusion attribute, rule loss in selective inclusion and other bugs * Exercise domain/list-name validators in tests * Consolidate parsed list state into ParsedList and simplify inclusion parsing Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Loyalsoldier <10487845+Loyalsoldier@users.noreply.github.com>
This commit is contained in:
@@ -143,20 +143,26 @@ func run() error {
|
||||
exportListSlice = []string{"_all_"}
|
||||
}
|
||||
|
||||
failedCount := 0
|
||||
for _, eplistname := range exportListSlice {
|
||||
if strings.EqualFold(eplistname, "_all_") {
|
||||
if err := exportAll(filepath.Base(*inputData)+"_plain.yml", geoSites); err != nil {
|
||||
fmt.Printf("[Error] failed to exportAll: %v\n", err)
|
||||
failedCount++
|
||||
continue
|
||||
}
|
||||
} else {
|
||||
if err := exportSite(eplistname, geoSites); err != nil {
|
||||
fmt.Printf("[Error] failed to exportSite: %v\n", err)
|
||||
failedCount++
|
||||
continue
|
||||
}
|
||||
}
|
||||
fmt.Printf("list: %q has been exported successfully\n", eplistname)
|
||||
}
|
||||
if failedCount > 0 {
|
||||
return fmt.Errorf("%d list(s) failed to be exported", failedCount)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user