Skip to content

Commit 55c3ae6

Browse files
committed
fixup! feat: Refactor repositories download contents
1 parent e66fe34 commit 55c3ae6

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

tools/metadata/main_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,13 +362,12 @@ func newTestServer(t *testing.T, ref string, files map[string]any) *httptest.Ser
362362
descriptionsContent = append(descriptionsContent, &github.RepositoryContent{
363363
Name: github.Ptr(path.Base(path.Dir(name))),
364364
})
365+
dlURL := server.URL + "/dl/" + name
365366
mux.HandleFunc(
366-
path.Join(repoPath, "contents/descriptions", path.Dir(name)),
367-
jsonHandler(refQuery, []*github.RepositoryContent{
368-
{
369-
Name: github.Ptr(path.Base(name)),
370-
DownloadURL: github.Ptr(server.URL + "/dl/" + name),
371-
},
367+
path.Join(repoPath, "contents/descriptions", name),
368+
jsonHandler(refQuery, &github.RepositoryContent{
369+
Name: github.Ptr(path.Base(name)),
370+
DownloadURL: github.Ptr(dlURL),
372371
}),
373372
)
374373
mux.HandleFunc(

0 commit comments

Comments
 (0)