From d397aaeaf04511a4b7a54052b14749800870859b Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Wed, 13 Aug 2025 08:40:11 -0500 Subject: [PATCH] Only delete install directory on success This makes debugging problems easier --- R/covr.R | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/R/covr.R b/R/covr.R index ab08ab43..d413ebb9 100644 --- a/R/covr.R +++ b/R/covr.R @@ -432,7 +432,6 @@ package_coverage <- function(path = ".", clean_objects(pkg$path) clean_gcov(pkg$path) clean_parse_data() - unlink(install_path, recursive = TRUE) }, add = TRUE) } @@ -541,6 +540,8 @@ package_coverage <- function(path = ".", if (!clean) { attr(coverage, "library") <- install_path + } else { + unlink(install_path, recursive = TRUE) } if (getOption("covr.filter_non_package", TRUE)) {