Skip to content

Commit

Permalink
fix link + logic
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Nov 21, 2024
1 parent a47ba4a commit efbf7ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions R/badge.R
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,12 @@ use_r_universe_badge <- function() {
pkg <- project_name()
# Get organization to construct R-universe link
repo_owner <- tryCatch(target_repo()$repo_owner, error = function(e) NA)
gh_org <- unique(repo_owner[!is.na(repo_owner)])
if (length(gh_org) == 0L) {
gh_org <- repo_owner[!is.na(repo_owner)]
if (length(gh_org) != 1L ) {
ui_abort(c(
"{.pkg {pkg}} must have a repo URL in DESCRITPION to create a badge.",
"Use {.fn usethis::use_badge} if you have a different configuration.",
"If {.pkg {pkg}} is on CRAN, you can also see {.url cran.dev/{pkg}}
"If {.pkg {pkg}} is on CRAN, you can also see {.url https://cran.dev/{pkg}}
for a redirect to the r-universe homepage."
))
}
Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/badge.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Error in `use_r_universe_badge()`:
x {TESTPKG} must have a repo URL in DESCRITPION to create a badge.
i Use `usethis::use_badge()` if you have a different configuration.
i If {TESTPKG} is on CRAN, you can also see <cran.dev/{TESTPKG}> for a redirect to the r-universe homepage.
i If {TESTPKG} is on CRAN, you can also see <https://cran.dev/{TESTPKG}> for a redirect to the r-universe homepage.

# use_posit_cloud_badge() handles bad and good input

Expand Down

0 comments on commit efbf7ff

Please sign in to comment.