Skip to content

Commit

Permalink
Set R-universe repotype in ds.package to collect GitHub repo info int…
Browse files Browse the repository at this point in the history
…o SOFTWARE.bib
  • Loading branch information
iagomosqueira committed Nov 19, 2023
1 parent f42646d commit e9fdb7f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/ds.package.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ ds.package <- function(package, author, year, title, version, source)
pkg <- packageDescription(package, lib.loc=c(file.path(boot.dir(), "library"),
.libPaths()))
repotype <- if(isTRUE(pkg$Repository == "CRAN")) "CRAN"
else if(isTRUE(grepl("r-universe", pkg$Repository))) "Runiverse"
else if(isTRUE(pkg$RemoteType == "github")) "GitHub"
else if(!is.null(pkg$Repository)) pkg$Repository
else NA_character_
Expand All @@ -54,7 +55,11 @@ ds.package <- function(package, author, year, title, version, source)
"/", pkg$GithubRepo,
if(!is.null(pkg$GithubSubdir))
paste0("/", pkg$GithubSubdir),
"@", substring(pkg$GithubSHA1, 1, 7)))
"@", substring(pkg$GithubSHA1, 1, 7)),
Runiverse=paste0(
sub('.*.com\\/', '', packageDescription('mse')$RemoteUrl), "@",
substring(pkg$RemoteSha, 1, 7))
)
}
source <- paste0(" source = {", source, "},")

Expand Down

0 comments on commit e9fdb7f

Please sign in to comment.