diff --git a/test/unit/testdotfile.cpp b/test/unit/testdotfile.cpp index b569df1..84e658a 100644 --- a/test/unit/testdotfile.cpp +++ b/test/unit/testdotfile.cpp @@ -54,7 +54,7 @@ void createTestDotfiles(const std::vector& fileNames, const std::ve } } -void removeTestDotfiles(const std::vector& files) +void removeTestDotfiles(const std::vector& files, bool deleteInHome = true) { for (auto file : files) { // Get the top-level directory @@ -68,6 +68,10 @@ void removeTestDotfiles(const std::vector& files) std::filesystem::remove_all(file); } + if (!deleteInHome) { + continue; + } + // Delete recursively in home directory file = homeDirectory / file; if (std::filesystem::exists(file) || std::filesystem::is_symlink(file)) {