Skip to content

Commit

Permalink
Test existence of EDITOR before attempting to use it
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelChirico authored Dec 10, 2024
1 parent d3b4a3c commit 0bcc462
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/edit.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ edit_file <- function(path, open = rlang::is_interactive()) {
ui_bullets(c("_" = "Modify {.path {pth(path)}}."))
if (rstudio_available() && rstudioapi::hasFun("navigateToFile")) {
rstudioapi::navigateToFile(path)
} else {
} else if (nzchar(Sys.which(Sys.getenv("EDITOR")))) {

Check warning on line 34 in R/edit.R

View check run for this annotation

Codecov / codecov/patch

R/edit.R#L34

Added line #L34 was not covered by tests
utils::file.edit(path)
}
invisible(path)
Expand Down

0 comments on commit 0bcc462

Please sign in to comment.