Commit e40eada5 authored by Lena Hersemann's avatar Lena Hersemann

Warning about script changes is now highlighted in red

parent e0205d4b
......@@ -18,6 +18,7 @@ suppressMessages(if (!require("knitr")) install.packages("knitr"))
suppressMessages(if (!require("stringr")) install.packages("stringr"))
suppressMessages(if (!require("rmarkdown")) install.packages("rmarkdown"))
suppressMessages(if (!require("diffobj")) install.packages("diffobj"))
suppressMessages(if (!require("crayon")) install.packages("crayon"))
# disabled because user script will fail if they load plyr before dplyr
#suppressMessages(if (!require("dplyr")) install.packages("dplyr"))
......@@ -83,8 +84,7 @@ print(paste0("differences between the recent_script (", recent_script, ") and th
diffFile(recent_script, r_script, mode = "sidebyside")
if(row_diff > 0) {
print("ATTENTION: the script has been changed")
cat("Would you like to overwrite the existing data? [Yes/No] ")
cat(red("ATTENTION: the script has been changed. Would you like to overwrite the existing data? [Yes/No] "))
inp <- readLines(file("stdin"), n = 1L)
if (!inp == "Yes" & !inp %in% "No") {
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment