Skip to content

Commit

Permalink
stop when rename of annotated DESCRIPTION fails
Browse files Browse the repository at this point in the history
  • Loading branch information
aronatkins committed Jan 2, 2024
1 parent 51dd9d6 commit 5456d3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/restore.R
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,9 @@ annotatePkgDesc <- function(pkgRecord, project, lib = libDir(project)) {
# Write it out using a temporary file so DESCRIPTION is never partial.
tmpf <- tempfile(tmpdir = dirname(descFile))
write_dcf(content, tmpf)
file.rename(tmpf, descFile)
if (!file.rename(tmpf, descFile)) {
stop("Unable to rename annotated package DESCRIPTION")
}
}

# Takes a vector of package names, and returns a logical vector that indicates
Expand Down

0 comments on commit 5456d3e

Please sign in to comment.