Commit f3c81acf authored by Lena Hersemann's avatar Lena Hersemann

fixed bug: now only files with .R extension are considered in the recent files selection

parent 4090dcee
...@@ -71,6 +71,7 @@ script_name <- str_replace(basename(r_script), ".R", "") ...@@ -71,6 +71,7 @@ script_name <- str_replace(basename(r_script), ".R", "")
current_script <- paste0(".", script_name, "_", format(Sys.time(), "%Y%m%d_%H%M.R")) current_script <- paste0(".", script_name, "_", format(Sys.time(), "%Y%m%d_%H%M.R"))
all_files <- file.info(list.files(".", pattern = paste0("\\.", script_name), all.files = T)) all_files <- file.info(list.files(".", pattern = paste0("\\.", script_name), all.files = T))
all_files <- all_files[str_detect(rownames(all_files), ".R$"),]
recent_script <- rownames(all_files)[which.max(all_files$mtime)] recent_script <- rownames(all_files)[which.max(all_files$mtime)]
if (identical(recent_script, character(0))) { if (identical(recent_script, character(0))) {
......
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