Skip to content

Commit

Permalink
Update and render Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexAxthelm committed Aug 12, 2024
1 parent b00faef commit b3457ae
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Generated by roxygen2: do not edit by hand

export(check_dir_writable)
export(check_file)
export(check_io)
export(export_manifest)
export(parse_raw_params)
importFrom(logger,log_debug)
Expand Down
19 changes: 19 additions & 0 deletions R/file_checks.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ check_dir_writable <- function(dir) {
return(dir_is_writable)
}

#' check_file
#'
#' check a filepath for existence, non-zero size, and non-directory status.
#'
#' @param filepath path to file
#' @return logical(1L), is the file valid?
#' @export
check_file <- function(filepath) {
log_trace("Checking if file exists: ", filepath)
pass <- FALSE
Expand All @@ -49,6 +56,18 @@ check_file <- function(filepath) {
return(invisible(pass))
}

#' check_io
#'
#' check `input_files` using \code{\link{check_file}} and `output_dirs` using
#' \code{\link{check_dir_writable}}.
#'
#' @param input_files list or vector of file paths to check with
#' \code{\link{check_file}}
#' @param output_dirs list or vector of directories to check with
#' \code{\link{check_dir_writable}}
#' @return logical(1L), are all files and directories valid? Note that function
#' will throw an error in situations where this is not TRUE.
#' @export
check_io <- function(
input_files = NULL,
output_dirs = NULL
Expand Down
17 changes: 17 additions & 0 deletions man/check_file.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions man/check_io.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions tests/testthat/test-check_dir_writable.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ test_that("check_dir_writable correctly registers writable directory", {
})

test_that("check_dir_writable correctly errors on missing directory", {
skip_on_os("windows")
test_dir <- withr::local_tempdir()
dne_dir <- file.path(test_dir, "does_not_exist")
expect_warning(
Expand Down

0 comments on commit b3457ae

Please sign in to comment.