fix: report unreadable sources and tidy the pipeline (#675)

A Stat error other than not-exist was reported as absent, and the --zip archive was readable by other users.
The rest is review follow-up: export no longer prints, one runner type, shared name helpers, a trimmed log API.
This commit is contained in:
Roger authored and GitHub committed 2026-11-01 23:42:13 +08:00
1 parent 6d6191b4c6
commit 4e98ba7884
33 files changed
+303 -315

No files matched your search

+5 -18
View File
@@ -1,8 +1,7 @@
package main
import (
"os"
"sort"
"io"
"strings"
"github.com/moond4rk/hackbrowserdata/internal/app"
@@ -11,29 +10,17 @@ import (
"github.com/moond4rk/hackbrowserdata/internal/log"
)
// browserNames lists this OS's browser IDs for the usage strings, sorted as they have always been listed.
func browserNames() string {
defs := browser.Supported()
ids := make([]string, 0, len(defs))
for _, d := range defs {
ids = append(ids, d.ID)
}
sort.Strings(ids)
return strings.Join(ids, "|")
return strings.Join(browser.IDs(), "|")
}
func categoryNames() string {
all := category.All()
names := make([]string, len(all))
for i, c := range all {
names[i] = c.String()
}
return strings.Join(names, ",")
return strings.Join(category.Names(), ",")
}
// report prints the run's summary; it is not part of the output, so failing to print it never fails the run.
func report(s app.Summary) {
if err := app.Report(os.Stderr, s); err != nil {
func report(w io.Writer, s app.Summary) {
if err := app.Report(w, s); err != nil {
log.Warnf("print summary: %v", err)
}
}