Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/doc readme #427

Merged
merged 4 commits into from
Mar 11, 2024
Merged

Feature/doc readme #427

merged 4 commits into from
Mar 11, 2024

Conversation

ArnaudBger
Copy link
Contributor

No description provided.

@billettc billettc merged commit 36bb72f into develop Mar 11, 2024
7 checks passed
@billettc billettc deleted the feature/DocREADME branch March 11, 2024 14:07
@@ -119,12 +119,41 @@ func (r *manifestConverter) manifestToPkg(manif *Manifest) (*pbsubstreams.Packag
return pkg, protoDefinitions, r.sinkConfigDynamicMessage, nil
}

func (m *Manifest) readFileFromName(filename string) ([]byte, error) {
if _, err := os.Stat(filepath.Join(m.Workdir, filename)); err == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this won't be case insensitive

func (r *manifestConverter) convertToPkg(m *Manifest) (pkg *pbsubstreams.Package, err error) {
doc := m.Package.Doc
if doc == "" {
readmeContent, err := m.readFileFromName("README.md")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you'll have a NotFound error here, you need to check fall back from there for checking README..

if err != nil {
return nil, fmt.Errorf("reading file: %w", err)
}
if readmeContent == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if err == nil, you'll never have a nil readmeContent. Not useful to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants