From 26224e3c7fe1f73f988ec85c8c95e944b3e412c5 Mon Sep 17 00:00:00 2001 From: Szymon Maksymiuk <32574056+maksymiuks@users.noreply.github.com> Date: Wed, 8 Jan 2025 20:15:38 +0100 Subject: [PATCH] Normalize install_path before creating dir (#593) * Normalzie install_path before creating dir * Update R/covr.R Co-authored-by: Jim Hester * Update NEWS.md Co-authored-by: Jim Hester --------- Co-authored-by: Jim Hester --- DESCRIPTION | 2 +- NEWS.md | 4 ++++ R/covr.R | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index af7f9615..f21ae135 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Encoding: UTF-8 Package: covr Title: Test Coverage for Packages -Version: 3.6.4.9003 +Version: 3.6.4.9004 Authors@R: c( person("Jim", "Hester", email = "james.f.hester@gmail.com", role = c("aut", "cre")), person("Willem", "Ligtenberg", role = "ctb"), diff --git a/NEWS.md b/NEWS.md index 5e103cde..6119767e 100644 --- a/NEWS.md +++ b/NEWS.md @@ -15,6 +15,10 @@ * Added support for `klmr/box` modules. This works best with `file_coverage()`. (@radbasa, #491) +* Normalize `install_path` path before creating directory to prevent + failures when running covr in a subprocess using a path with Windows + `\\` path separators. (@maksymiuks, #592) + # covr 3.6.4 * Fix for a failing test on CRAN diff --git a/R/covr.R b/R/covr.R index 575a0f83..1daee8d0 100644 --- a/R/covr.R +++ b/R/covr.R @@ -410,9 +410,9 @@ package_coverage <- function(path = ".", root <- NULL } - dir.create(install_path) # tools::testInstalledPackage requires normalized install_path (#517) install_path <- normalize_path(install_path) + dir.create(install_path) flags <- getOption("covr.flags")