Files
Rpacman/R/snapshot_latest.R
2023-09-28 09:44:06 +01:00

14 lines
339 B
R

#' Load the latest snapshot state from the lock file
#'
#' @return A list containing the last saved snapshot of the project state
#' @import jsonlite
#' @export
snapshot_latest <- function() {
if (!file.exists("pacman.lock")) {
return(NULL)
}
state <- jsonlite::read_json("pacman.lock")
state$history <- NULL
return(state)
}