From 3b744b7a5e365caa1b0efde7a530c95dccf10a8f Mon Sep 17 00:00:00 2001 From: Maksim Denisov Date: Thu, 17 Apr 2025 17:10:59 +0200 Subject: FileSystemManager: Always copy directories recursively --- src/buildtool/file_system/file_system_manager.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/buildtool/file_system/file_system_manager.hpp') diff --git a/src/buildtool/file_system/file_system_manager.hpp b/src/buildtool/file_system/file_system_manager.hpp index a6d15c84..528d50ca 100644 --- a/src/buildtool/file_system/file_system_manager.hpp +++ b/src/buildtool/file_system/file_system_manager.hpp @@ -408,10 +408,10 @@ class FileSystemManager { return false; } + /// \brief Copy directory recursively [[nodiscard]] static auto CopyDirectoryImpl( std::filesystem::path const& src, - std::filesystem::path const& dst, - bool recursively = false) noexcept -> bool { + std::filesystem::path const& dst) noexcept -> bool { try { // also checks existence if (not IsDirectory(src)) { @@ -428,11 +428,10 @@ class FileSystemManager { dst.string()); return false; } - auto const opts = + static constexpr auto kOptions = std::filesystem::copy_options::copy_symlinks | - (recursively ? std::filesystem::copy_options::recursive - : std::filesystem::copy_options::none); - std::filesystem::copy(src, dst, opts); + std::filesystem::copy_options::recursive; + std::filesystem::copy(src, dst, kOptions); return true; } catch (std::exception const& e) { Logger::Log(LogLevel::Error, -- cgit v1.2.3