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

check if README.md exists before attempting to read it #490

Merged
merged 1 commit into from Apr 29, 2018

Conversation

Projects
None yet
3 participants
@22a
Contributor

22a commented Dec 13, 2017

Problem

This PR addresses #432, a bug where esdoc fails to run if a README.md file 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 the ESDoc Config table here: https://github.com/esdoc/esdoc-site/blob/master/src/manual/config.md

Outcome

Resolves #432 and duplicate #484.

@22a

This comment has been minimized.

Contributor

22a commented Dec 13, 2017

Hi @h13i32maru, thoughts on this?

@MattMcFarland

This comment has been minimized.

Contributor

MattMcFarland commented Dec 13, 2017

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.

#480

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 👍
https://github.com/esdoc2/esdoc2.git

@22a

This comment has been minimized.

Contributor

22a commented Dec 13, 2017

@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.

@h13i32maru h13i32maru merged commit e1d0d8c into esdoc:master Apr 29, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment