-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dev: Use package caching on Travis Create folder recursively Try once more #233 Explicitly save manifest.R #233 Try writing to getwd() Use dirname(tempdir()) to persist .checkpoint folder #233 Rebuild vignettes #233 Add vignette on using checkpoint inside a markdown file #216 Add argument documentation Add experimental unCheckpoint() function #124 Skip all online checks if `scanForPackages = FALSE` #234 Expand help for mranUrl() #237 Documentation improvements and fixes Track snapshot use and remove unused snapshots #209
- Loading branch information
Showing
26 changed files
with
564 additions
and
145 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Write a small file into the snapshot that contains the last date this snapshot was accessed by checkpoint() | ||
writeAccessDate <- function(snapshotDate, checkpointLocation = "~/"){ | ||
today <- strftime(Sys.Date(), "%Y-%m-%d", tz = FALSE) | ||
if(missing(snapshotDate) || is.null(snapshotDate)){ | ||
snapshotDate <- today | ||
} | ||
cpdir <- checkpointPath(snapshotDate, | ||
checkpointLocation = checkpointLocation, | ||
type = "snapshot") | ||
lastaccessFile <- file.path(cpdir, ".lastaccessed") | ||
writeLines(today, con = lastaccessFile) | ||
} | ||
|
||
|
||
#' Returns the date the snapshot was last accessed. | ||
#' | ||
#' The [checkpoint()] function stores a marker in the snapshot folder every time the function gets called. This marker contains the system date, thus indicating the the last time the snapshot was accessed. | ||
#' | ||
#' @inheritParams checkpoint | ||
#' @return Named character with last access date | ||
#' @export | ||
#' @family checkpoint functions | ||
#' @seealso [checkpointRemove()] | ||
getAccessDate <- function(checkpointLocation = "~/"){ | ||
cp <- checkpointPath(NULL, | ||
checkpointLocation = checkpointLocation, | ||
type = "root" | ||
) | ||
z <- dir(cp, pattern = ".{4}-.{2}-.{2}", | ||
include.dirs = TRUE, | ||
full.names = TRUE | ||
) | ||
sapply(z, function(x){ | ||
laf <- file.path(x, ".lastaccessed") | ||
if(file.exists(laf)) readLines(laf) else NA | ||
}) | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
mranUrl() | ||
|
||
\dontrun{ | ||
|
||
# Store the existing options | ||
old_opts <- getOption("checkpoint.mranUrl") | ||
|
||
# Set MRAN URL to different http address | ||
options(checkpoint.mranUrl = "https://foobah") | ||
|
||
# Set MRAN URL to local file address | ||
options(checkpoint.mranUrl = "file:///~") | ||
|
||
# Reset the original options | ||
options(checkpoint.mranUrl = old_opts) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.