Skip to content

Commit

Permalink
Bugfix for nested directories, silence warnings for hard link failure.
Browse files Browse the repository at this point in the history
  • Loading branch information
LTLA committed Apr 11, 2024
1 parent aff6359 commit d2ce920
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions R/uploadDirectory.R
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit d2ce920

Please sign in to comment.