diff options
author | Maksim Denisov <denisov.maksim@huawei.com> | 2025-04-17 17:10:59 +0200 |
---|---|---|
committer | Maksim Denisov <denisov.maksim@huawei.com> | 2025-04-22 13:50:57 +0200 |
commit | 3b744b7a5e365caa1b0efde7a530c95dccf10a8f (patch) | |
tree | 67d6f62e12d433a4fddfd1a2b68302fec59df662 /src/buildtool/file_system/file_system_manager.hpp | |
parent | 8b57548de9836fce3663b99d0140146f12668e8c (diff) | |
download | justbuild-3b744b7a5e365caa1b0efde7a530c95dccf10a8f.tar.gz |
FileSystemManager: Always copy directories recursively
Diffstat (limited to 'src/buildtool/file_system/file_system_manager.hpp')
-rw-r--r-- | src/buildtool/file_system/file_system_manager.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
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, |