Skip to content

Commit

Permalink
adjustments to use target_repo_spec()
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Nov 21, 2024
1 parent a397f9c commit a47ba4a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions R/badge.R
Original file line number Diff line number Diff line change
Expand Up @@ -155,12 +155,9 @@ use_r_universe_badge <- function() {
# The r-universe link needs the package name + organization.

pkg <- project_name()
url <- tryCatch(github_url(pkg), error = function(e) NULL)
# in order to get organization
desc <- proj_desc()
urls <- desc$get_urls()
dat <- parse_github_remotes(c(urls, url))
gh_org <- unique(dat$repo_owner[!is.na(dat$repo_owner)])
# 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) {
ui_abort(c(
"{.pkg {pkg}} must have a repo URL in DESCRITPION to create a badge.",
Expand Down

0 comments on commit a47ba4a

Please sign in to comment.