Skip to content

Commit 6327e8c

Browse files
committed
Correctly try usethis
1 parent 94f1229 commit 6327e8c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

R/blog.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ new_blog_post <- function(
4444
if (open) {
4545
edit_file <- utils::file.edit
4646
if (
47-
rlang::is_installed("usethis") && rlang::is_callable(usethis::edit_file)
47+
rlang::is_installed("usethis") &&
48+
is.function(asNamespace("usethis")$edit_file)
4849
) {
49-
edit_file <- getFromNamespace("edit_file", "usethis")
50+
edit_file <- utils::getFromNamespace("edit_file", "usethis")
5051
}
5152
edit_file(qmd_path)
5253
}

0 commit comments

Comments
 (0)