From d2ce9204d3e3282cdabcb2df901e4e60936d29ce Mon Sep 17 00:00:00 2001 From: LTLA Date: Wed, 10 Apr 2024 17:06:40 -0700 Subject: [PATCH] Bugfix for nested directories, silence warnings for hard link failure. --- DESCRIPTION | 2 +- R/uploadDirectory.R | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 2313265..21361fb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,5 +1,5 @@ Package: gobbler -Version: 0.3.0 +Version: 0.3.1 Date: 2024-04-10 Title: Interface to the gobbler service Description: diff --git a/R/uploadDirectory.R b/R/uploadDirectory.R index f8d9624..122d1b7 100644 --- a/R/uploadDirectory.R +++ b/R/uploadDirectory.R @@ -47,11 +47,11 @@ uploadDirectory <- function(project, asset, version, directory, staging, url, pr for (p in list.files(directory, recursive=TRUE)) { src <- file.path(directory, p) dest <- file.path(new.dir, p) - dir.create(dirname(dest), showWarnings=FALSE) + dir.create(dirname(dest), recursive=TRUE, showWarnings=FALSE) src.link <- Sys.readlink(src) if (src.link == "" || !startsWith(src, "/")) { # i.e., not a link to an absolute path. - if (!file.link(src, dest) && !file.copy(src, dest)) { + if (!suppressWarnings(file.link(src, dest)) && !file.copy(src, dest)) { stop("failed to link or copy '", p, "' to the staging directory") } } else {