R/refresh_current_project_log.R

Defines functions refresh_current_project_log

Documented in refresh_current_project_log

#' Gets the last entry in the PROJECT_LOG$HISTORY for each directory being logged and moves it to PROJECT_LOG$CURRENT
#' @export
refresh_current_project_log <-
        function() {
                tmp_project_log <- get("PROJECT_LOG", envir = globalenv())
                x <- list()
                for (i in 1:length(tmp_project_log$HISTORY)) {
                        x[[i]] <- tail_list(tmp_project_log$HISTORY[[i]])
                }
                names(x) <- names(tmp_project_log$HISTORY)
                tmp_project_log$CURRENT <- x
                saveRDS(tmp_project_log, "PROJECT_LOG.RData")
                assign("PROJECT_LOG", tmp_project_log, envir = globalenv())
        }
patelm9/projectloggeR documentation built on Nov. 4, 2019, 11:21 p.m.