Skip to content

Commit

Permalink
Fixup links
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Dec 6, 2023
1 parent 156093d commit cda2894
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions R/browse.R
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ github_url <- function(package = NULL) {
ui_warn("
Package {ui_value(package)} has no GitHub URLs in DESCRIPTION
Trying the GitHub CRAN mirror")
cli::format_inline("{.url https://github.com/cran/{package}}")
glue::glue("https://github.com/cran/{package}")
}

cran_home <- function(package = NULL) {
package <- package %||% project_name()
cli::format_inline("{.url https://cran.r-project.org/package={package}}")
glue::glue("https://cran.r-project.org/package={package}")
}

# returns NULL, if no DESCRIPTION found
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-browse.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ test_that("github_url() strips everything after USER/REPO", {

test_that("github_url() has fall back for CRAN packages", {
expect_warning(out <- github_url("utils"), "CRAN mirror")
expect_equal(out, "<https://github.com/cran/utils>")
expect_equal(out, "https://github.com/cran/utils")
})

test_that("github_url() errors for nonexistent package", {
Expand Down

0 comments on commit cda2894

Please sign in to comment.