Skip to content

Commit

Permalink
Use dev news for r-lib.org, tidyverse.org, and tidymodels.org
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed May 17, 2024
1 parent aa4cac8 commit cbba60e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion R/browse-pkg.R
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,11 @@ browse_pkg <- function(package = NULL,
)

pkgdown <- stringr::str_remove(pkgdown, "/$")
pkgdown_tabs_url <- paste0(pkgdown, "/", pkgdown_tabs)
pkgdown_tabs_url <- paste0(pkgdown, "/", pkgdown_tabs, "/")
if (stringr::str_detect(pkgdown, "r-lib.org|tidyverse.org|tidymodels.org") && !stringr::str_detect(pkgdown, "github.com")) {
# known packages with dev enabled.
pkgdown_tabs_url[1] <- paste0(pkgdown, "/dev/news")
}
names(pkgdown_tabs_url) <- pkgdown_tabs
if (news_only) {
return(cli::style_hyperlink("news", pkgdown_tabs_url["news"]))
Expand Down
4 changes: 2 additions & 2 deletions R/outdated-pkgs.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ outdated_pkgs <- function(type = c("binary", "source")) {
# Stop early for pak update before
if (rlang::has_name(outdated_pkg, "pak")) {
cli::cli_inform(c(
"v" = "There is a new version of pak.",
"v" = "There is a new version of {.href [pak](https://pak.r-lib.org/dev/news/index.html)}.",
"i" = "Update pak with {.run pak::pak_update()}",
"i" = "Restart R session then run `outdated_pkgs()` again."
"i" = "Restart R session then run {.run [outdated_pkgs()](reuseme::outdated_pkgs())}` again."
))
return(invisible())
}
Expand Down

0 comments on commit cbba60e

Please sign in to comment.