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

Test existence of EDITOR before attempting to use it #2088

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MichaelChirico
Copy link
Contributor

@MichaelChirico MichaelChirico commented Dec 10, 2024

Ran into this ugly output from usethis::use_package_doc() on a GitHub codespace (which is intentionally lightweight):

✔ Setting active project to "/workspaces/lori".
✔ Writing R/lori-package.R.
☐ Modify R/lori-package.R.
sh: 1: vi: not found
☐ Run `devtools::document()` to update package-level documentation.
Warning message:
error in running command

The problem is R prefers EDITOR=vi by default (even if it's not available).

A more advanced fix might instead come up with a {usethis}-internal ordered list of editors to try, iterating over them and using the first found installed. But anyway this PR is a good first improvement.

I started an r-devel thread too:

https://stat.ethz.ch/pipermail/r-devel/2024-December/083717.html

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.

1 participant