From 1a0a97d75847cb12e8a0fe098a78ad4d8422b59e Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Mon, 25 Sep 2023 12:08:04 +0300 Subject: [PATCH] Fix non-WSL asserts --- R/utils.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/utils.R b/R/utils.R index 519a21f8..85f66bf1 100644 --- a/R/utils.R +++ b/R/utils.R @@ -596,7 +596,7 @@ wsl_tempdir <- function() { # network path as legitimate, and will always error. To avoid this we create a # new checking functions with WSL handling, and then pass these to # checkmate::makeAssertionFunction to replicate the existing assertion functionality -check_dir_exists <- function(dir, access = NULL) { +check_dir_exists <- function(dir, access = "") { if (os_is_wsl()) { if (!checkmate::qtest(dir, "S+")) { return("No directory provided.") @@ -612,7 +612,7 @@ check_dir_exists <- function(dir, access = NULL) { } } -check_file_exists <- function(files, access = NULL, ...) { +check_file_exists <- function(files, access = "", ...) { if (os_is_wsl()) { if (!checkmate::qtest(files, "S+")) { return("No file provided.") @@ -628,7 +628,7 @@ check_file_exists <- function(files, access = NULL, ...) { } } -.wsl_check_exists <- function(path, is_dir = TRUE, access = NULL) { +.wsl_check_exists <- function(path, is_dir = TRUE, access = "") { path_check <- processx::run( command = "wsl", args = c("ls", "-la", wsl_safe_path(path)),