check if README.md exists before attempting to read it#490
Merged
h13i32maru merged 1 commit intoesdoc:masterfrom Apr 29, 2018
22a:master
Merged
check if README.md exists before attempting to read it#490h13i32maru merged 1 commit intoesdoc:masterfrom 22a:master
h13i32maru merged 1 commit intoesdoc:masterfrom
22a:master
Conversation
Contributor
Author
|
Hi @h13i32maru, thoughts on this? |
Contributor
|
Unfortunately it's been very hard getting word back from the author, he's not very responsive anymore, some of the dependencies are over a year old now, and he wont let anyone join his organization. I've since moved on with esdoc2, would recommend you check it out and send the PR there if you would be so kind to do so 👍 |
Contributor
Author
|
@MattMcFarland Thanks for the info, Matt! Nice work on #480! I'll get set up with esdoc2 and see if I can replicate the issue, if so I'll submit a PR there. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
This PR addresses #432, a bug where esdoc fails to run if a
README.mdfile is not present at the root of a given project. The bug occurs because the default behaviour of esdoc is to attempt to read that file regardless of whether or not it exists.Solution
The simple solution here is to check if the file exists before attempting to read from it, and fall back to empty string as the index content if the file does not exist.
Further thoughts
On the issue there are reports of esdoc also crashing if a readme is present at the top level of the project but its not named exactly
README.md, which may frequently be the case on case sensitive file systems. This PR does not remedy that scenario by reading the correct file but it will at least allow esdoc to run without crashing. It is up to the user then to find the correct configuration option from theESDoc Configtable here: https://github.com/esdoc/esdoc-site/blob/master/src/manual/config.mdOutcome
Resolves #432 and duplicate #484.