From 64990b64853e55549c057d31bbbac2d455c600cb Mon Sep 17 00:00:00 2001 From: sbreitbart-NOAA Date: Mon, 2 Mar 2026 16:42:52 -0500 Subject: [PATCH 1/2] Update prompt about preamble as per https://github.com/nmfs-ost/asar/issues/416#issuecomment-3873703343 --- R/create_template.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/create_template.R b/R/create_template.R index 0bef0cb6..0df6f822 100644 --- a/R/create_template.R +++ b/R/create_template.R @@ -890,7 +890,9 @@ create_template <- function( # extract old preamble if don't want to change if (rerender_skeleton) { - question1 <- readline("Do you want to keep the current preamble? (Y/N)") + question1 <- readline("As you are rerendering your report skeleton, +you may need a new preamble. +Do you want to keep the current preamble? (Y/N)") # answer question1 as y if session isn't interactive if (!interactive()) { From d631cadce3290a97cd406823a3624cf23103c1e7 Mon Sep 17 00:00:00 2001 From: sbreitbart-NOAA Date: Wed, 4 Mar 2026 09:18:26 -0500 Subject: [PATCH 2/2] Update prompt about preamble to exactly match suggestion in https://github.com/nmfs-ost/asar/issues/416#issuecomment-3873703343 --- R/create_template.R | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/R/create_template.R b/R/create_template.R index 0df6f822..4b707bde 100644 --- a/R/create_template.R +++ b/R/create_template.R @@ -890,15 +890,13 @@ create_template <- function( # extract old preamble if don't want to change if (rerender_skeleton) { - question1 <- readline("As you are rerendering your report skeleton, -you may need a new preamble. -Do you want to keep the current preamble? (Y/N)") + question1 <- readline("Update the preamble to match entered arguments? (Y/N)") - # answer question1 as y if session isn't interactive + # answer question1 as n if session isn't interactive if (!interactive()) { - question1 <- "y" + question1 <- "n" } - if (regexpr(question1, "y", ignore.case = TRUE) == 1) { + if (regexpr(question1, "n", ignore.case = TRUE) == 1) { start_line <- grep("output_and_quantities", prev_skeleton) - 1 # find next trailing "```"` in case it was edited at the end end_line <- grep("```", prev_skeleton)[grep("```", prev_skeleton) > start_line][1] @@ -958,7 +956,7 @@ Do you want to keep the current preamble? (Y/N)") cli::cli_alert_info("Model results not updated.") preamble <- paste(preamble, collapse = "\n") } - } else if (regexpr(question1, "n", ignore.case = TRUE) == 1) { + } else if (regexpr(question1, "y", ignore.case = TRUE) == 1) { cli::cli_alert_warning("Report template files were not copied into your directory.") cli::cli_alert_info("If you wish to update the template with new parameters or output files, please edit the {report_name} in your local folder.", wrap = TRUE