cmd/mbf: integrate pkgserver into command info

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-02 05:05:56 +09:00
parent 09e23b8822
commit a0c1641e2f
17 changed files with 69 additions and 104 deletions

View File

@@ -95,7 +95,7 @@ status : not in report
var (
cm *cache
buf strings.Builder
rp string
r *rosa.Report
)
if tc.status != nil || tc.report != "" {
@@ -108,14 +108,25 @@ status : not in report
}
if tc.report != "" {
rp = filepath.Join(t.TempDir(), "report")
if err := os.WriteFile(
rp,
pathname := filepath.Join(t.TempDir(), "report")
err := os.WriteFile(
pathname,
unsafe.Slice(unsafe.StringData(tc.report), len(tc.report)),
0400,
); err != nil {
)
if err != nil {
t.Fatal(err)
}
r, err = rosa.OpenReport(pathname)
if err != nil {
t.Fatal(err)
}
defer func() {
if err = r.Close(); err != nil {
t.Fatal(err)
}
}()
}
if tc.status != nil {
@@ -157,7 +168,7 @@ status : not in report
tc.args,
&buf,
cm != nil,
rp,
r,
); !reflect.DeepEqual(err, wantErr) {
t.Fatalf("commandInfo: error = %v, want %v", err, wantErr)
}