Skip to content

Commit

Permalink
add link to commit if available
Browse files Browse the repository at this point in the history
  • Loading branch information
Maëlle Salmon committed Apr 23, 2018
1 parent a4c1f10 commit fec19c8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions R/create_codemeta.R
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@ create_codemeta <- function(pkg = ".",
cm$relatedLink <- unique(c(cm$relatedLink,
paste0("https://bioconductor.org/packages/release/bioc/html/",
cm$identifier, ".html")))
}else{
# if GitHub try to build the URL to commit or to repo in general
if(grepl("Github", provider_name)){
if(grepl("@", provider_name)){
commit <- gsub(".*@", "", provider_name)
commit <- gsub("\\)", "", commit)
link <- gsub(".*\\(", "", provider_name)
link <- gsub("@.*", "", link)
cm$relatedLink <- unique(c(cm$relatedLink,
paste0("https://github.com/", link,
"/commit/", commit)))
}
}
}
}
}else{
Expand Down

0 comments on commit fec19c8

Please sign in to comment.