Commit d76f6734 authored by Jonathan Mang's avatar Jonathan Mang 💡
Browse files

fix: fixed feedback function to also work with empty or NULL logfile_dir

parent d9374190
Pipeline #22439 failed with stages
in 12 minutes and 36 seconds
Package: DIZutils
Title: Utilities for 'DIZ' R Package Development
Version: 0.0.6.9004
Date: 2021-01-08
Version: 0.0.6.9005
Date: 2021-01-19
Authors@R:
c(person(given = "Jonathan M.",
family = "Mang",
......
......@@ -271,7 +271,21 @@ feedback_to_logfile <-
# and a linebreak at the end:
res <- paste0("[", Sys.time(), "] ", res, "\n")
logfile_dir <- repair_dir(logfile_dir)
logfile_dir <- DIZutils::clean_path_name(pathname = logfile_dir,
remove.slash = FALSE)
if (rapportools::is.empty(logfile_dir)) {
DIZutils::feedback(
print_this = paste0(
"'logfile_dir' was empty and automatically",
" switched to 'tempdir()' in the previous log-entry."
),
type = "Warning",
findme = "215d74c51d"
)
logfile_dir <- tempdir()
}
path_with_file <- paste0(logfile_dir, "logfile.log")
# Open the connection to the logfile:
......@@ -282,12 +296,6 @@ feedback_to_logfile <-
close(log_con)
}
repair_dir <- function(dir) {
if (!grepl("\\/$", dir)) {
dir <- paste0(dir, "/")
}
return(dir)
}
#' @title Format the feedback string
#' @description Helper function for the feedback function to combine the input
......
......@@ -37,7 +37,7 @@ my_desc$set_authors(c(
my_desc$del("Maintainer")
# Set the version
my_desc$set_version("0.0.6.9004")
my_desc$set_version("0.0.6.9005")
# The title of your package
my_desc$set(Title = "Utilities for 'DIZ' R Package Development")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment