mirror of https://github.com/mamba-org/mamba.git
Use standard C++ filesystem API only
This commit is contained in:
parent
73997ab005
commit
9790a87a5d
|
@ -12,7 +12,6 @@ dependencies:
|
|||
- libcurl 7.82.0 *_0
|
||||
- gtest
|
||||
- gmock
|
||||
- cpp-filesystem >=1.5.8
|
||||
- cpp-expected
|
||||
- reproc-cpp
|
||||
- yaml-cpp
|
||||
|
|
|
@ -1,13 +1,8 @@
|
|||
#ifndef MAMBA_CORE_FS_HPP
|
||||
#define MAMBA_CORE_FS_HPP
|
||||
|
||||
#ifdef MAMBA_USE_STD_FS
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
namespace fs = std::filesystem;
|
||||
#else
|
||||
#include "ghc/filesystem.hpp"
|
||||
namespace fs = ghc::filesystem;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -155,7 +155,15 @@ namespace mamba
|
|||
if (!fs::exists(env_txt_file))
|
||||
return {};
|
||||
|
||||
fs::path abs_loc = fs::absolute(location);
|
||||
std::error_code fsabs_error;
|
||||
fs::path abs_loc = fs::absolute(
|
||||
location, fsabs_error); // If it fails we just get the defaultly constructed path.
|
||||
if (fsabs_error && !location.empty()) // Ignore cases where we got an empty location.
|
||||
{
|
||||
LOG_WARNING << fmt::format("Failed to get absolute path for location '{}' : {}",
|
||||
location.string(),
|
||||
fsabs_error.message());
|
||||
}
|
||||
|
||||
std::vector<std::string> lines = read_lines(env_txt_file);
|
||||
std::set<std::string> final_lines;
|
||||
|
|
|
@ -12,7 +12,6 @@ dependencies:
|
|||
- libcurl 7.82.0 *_0
|
||||
- gtest
|
||||
- gmock
|
||||
- cpp-filesystem >=1.5.8
|
||||
- cpp-expected
|
||||
- reproc-cpp
|
||||
- yaml-cpp
|
||||
|
|
|
@ -12,7 +12,6 @@ dependencies:
|
|||
- libcurl 7.82.0 *_0
|
||||
- gtest
|
||||
- gmock
|
||||
- cpp-filesystem >=1.5.8
|
||||
- cpp-expected
|
||||
- reproc-cpp
|
||||
- yaml-cpp
|
||||
|
|
|
@ -12,7 +12,6 @@ dependencies:
|
|||
- libcurl 7.82.0 *_0
|
||||
- gtest
|
||||
- gmock
|
||||
- cpp-filesystem >=1.5.8
|
||||
- cpp-expected
|
||||
- reproc-cpp
|
||||
- yaml-cpp
|
||||
|
|
Loading…
Reference in New Issue