Skip to content

Commit

Permalink
Bug- fix cert pages with no cert preview (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
angelina-momin authored Nov 12, 2024
1 parent b033d0a commit ec50415
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: codecheck
Title: Helper Functions for CODECHECK Project
Version: 0.11.0
Version: 0.11.1
Authors@R:
c(person(given = "Stephen",
family = "Eglen",
Expand Down
7 changes: 6 additions & 1 deletion R/utils_render_cert_htmls.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ render_cert_htmls <- function(register_table, force_download = FALSE){
Sys.sleep(CONFIG$CERT_REQUEST_DELAY)
}

render_cert_html(cert_id, register_table[i, ]$Repository, download_cert_status=1)
# The pdf exists and force download is False
else{
download_cert_status <- 1
}

render_cert_html(cert_id, register_table[i, ]$Repository, download_cert_status)
}
}

Expand Down
3 changes: 2 additions & 1 deletion R/utils_render_cert_md.R
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ add_abstract <- function(repo_link, md_content){
create_cert_md <- function(cert_id, repo_link, download_cert_status){
cert_dir <- file.path(CONFIG$CERTS_DIR[["cert"]], cert_id)

# Initially checking if a cert is available
# Loading the correct template based on whether cert exists
if (download_cert_status == 0) {
template_type <- "md_template_no_cert"
}
Expand All @@ -218,6 +218,7 @@ create_cert_md <- function(cert_id, repo_link, download_cert_status){

# We add the report link in the subtext when we do not have cert
if (download_cert_status == 0){
config_yml <- get_codecheck_yml(repo_link)
report_hyperlink <- paste0("[link](", config_yml$report, ")")
md_content <- gsub("\\$codecheck_report_subtext\\$", report_hyperlink, md_content)
}
Expand Down

0 comments on commit ec50415

Please sign in to comment.