Commit fff7ba77 authored by Dan Baston's avatar Dan Baston

Insert newline into history if needed

parent 24780a8d
Pipeline #75442402 passed with stages
in 21 minutes and 35 seconds
......@@ -23,7 +23,11 @@ standard_netcdf_attrs <- function(is_new, is_spatial, existing_history=NULL) {
if (!is.null(existing_history)) {
if (endsWith(existing_history, history)) {
# skip adding history to avoid duplicate entry
history <- existing_history
} else if (nchar(existing_history) > 0 && !endsWith(existing_history, '\n')) {
# previous history entry didn't end with a newline, so we add it here
history <- paste0(existing_history, '\n', history)
} else {
history <- paste0(existing_history, history)
}
......
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