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

use_github_release() fails uninformatively when there are no lines in NEWS.md section #1048

Closed
petrbouchal opened this issue Mar 14, 2020 · 2 comments · Fixed by #1073
Closed
Labels
bug release 🛫

Comments

@petrbouchal
Copy link

@petrbouchal petrbouchal commented Mar 14, 2020

Brief description of the problem

When no lines exist in the latest section of NEWS.md, use_github_release() returns Error in text[[1]] : subscript out of bounds.

Reprex:

NEWS.md:

# pkg 0.2.0

# pkg 0.1.0

* news line

Code run:

use_github_release

The error occurs in news_latest() where code removing blank lines errors on an empty string.

This probably typically occurs because the user has taken usethis steps out of sequence, so the most sensible solution would be to stop with an informative error and advise the user to document the release in NEWS.md. Alternatively the function could pass the resulting newline and issue a warning advising the user to document their release when submitting the form on Github.

Happy to try a PR if you can indicate which solution you prefer.

@hadley hadley added bug release 🛫 labels Mar 17, 2020
hadley added a commit that referenced this issue Mar 19, 2020
@hadley
Copy link
Member

@hadley hadley commented Mar 19, 2020

Sorry, missed your offer to create a PR; but this was pretty quick for me anyway.

@hadley
Copy link
Member

@hadley hadley commented Mar 19, 2020

(And it needed some refactoring to make it easier to test)

hadley added a commit that referenced this issue Mar 22, 2020
Including refactoring of news_latest() in order to test it

Fixes #1048
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug release 🛫
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants