From 54654d50beb56801019fd233516c76638f8d3fda Mon Sep 17 00:00:00 2001 From: Candace Savonen Date: Wed, 23 Feb 2022 16:09:08 -0500 Subject: [PATCH] Fix order of steps --- scripts/make_screenshots.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/make_screenshots.R b/scripts/make_screenshots.R index 5c607084..c57a182e 100644 --- a/scripts/make_screenshots.R +++ b/scripts/make_screenshots.R @@ -52,16 +52,16 @@ if (!dir.exists(output_folder)) { if (is.null(opt$base_url)) { base_url <- cow::get_pages_url(repo_name = opt$repo, git_pat = opt$git_pat) + base_url <- gsub("/$", "", base_url) } chapt_df <- ottrpal::get_chapters(base_url = file.path(base_url, "no_toc/")) - file_names <- lapply(chapt_df$url, function(url) { file_name <- gsub(".html", ".png", file.path(output_folder, basename(url))) # Get rid of special characters - file_name <- gsub(":|?|!|\\'", "", file_name) webshot::webshot(url, file_name) + file_name <- gsub(":|?|!|\\'", "", file_name) message(paste("Screenshot saved:", file_name)) return(file_name) })