From 5ababc28c3337dbf33d5e2b9bf4918012e1bb330 Mon Sep 17 00:00:00 2001 From: arnaudberger Date: Fri, 8 Mar 2024 16:49:59 -0500 Subject: [PATCH] Handling README --- manifest/package.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/manifest/package.go b/manifest/package.go index ae4f7c5c4..28287857c 100644 --- a/manifest/package.go +++ b/manifest/package.go @@ -122,14 +122,24 @@ func (r *manifestConverter) manifestToPkg(manif *Manifest) (*pbsubstreams.Packag func (r *manifestConverter) convertToPkg(m *Manifest) (pkg *pbsubstreams.Package, err error) { doc := m.Package.Doc if doc == "" { - readmePath := filepath.Join(m.Workdir, "README.md") - if _, err := os.Stat(readmePath); err == nil { + var readmePath string + if _, err := os.Stat(filepath.Join(m.Workdir, "README.md")); err == nil { + readmePath = filepath.Join(m.Workdir, "README.md") content, err := os.ReadFile(readmePath) if err != nil { return nil, fmt.Errorf("failed to read README.md: %w", err) } doc = string(content) } + + if _, err := os.Stat(filepath.Join(m.Workdir, "README")); err == nil { + readmePath = filepath.Join(m.Workdir, "README") + content, err := os.ReadFile(readmePath) + if err != nil { + return nil, fmt.Errorf("failed to read README: %w", err) + } + doc = string(content) + } } pkgMeta := &pbsubstreams.PackageMetadata{