-
Notifications
You must be signed in to change notification settings - Fork 47
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
Feature/doc readme #427
Conversation
@@ -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 { |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
No description provided.