Skip to content

Test existence of EDITOR before attempting to use it #2088

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

Closed
wants to merge 1 commit into 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

@jennybc
Copy link
Member

jennybc commented Jul 29, 2025

I read through the linked thread and find that I really feel like this is out of scope for usethis. I think it is quite rare that a usethis user is going to run into this and the possible downsides of getting involved with this just don't seem worth it to me.

@jennybc jennybc closed this Jul 29, 2025
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.

2 participants