Skip to content

Commit

Permalink
Use standard C++ filesystem API only
Browse files Browse the repository at this point in the history
  • Loading branch information
Klaim committed May 10, 2022
1 parent 070b6e3 commit f80df10
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion libmamba/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- libcurl 7.82.0 *_0
- gtest
- gmock
- cpp-filesystem >=1.5.8
- cpp-expected
- reproc-cpp
- yaml-cpp
Expand Down
5 changes: 0 additions & 5 deletions libmamba/include/mamba/core/mamba_fs.hpp
Original file line number Diff line number Diff line change
@@ -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
10 changes: 9 additions & 1 deletion libmamba/src/core/environments_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion libmambapy/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- libcurl 7.82.0 *_0
- gtest
- gmock
- cpp-filesystem >=1.5.8
- cpp-expected
- reproc-cpp
- yaml-cpp
Expand Down
1 change: 0 additions & 1 deletion mamba/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- libcurl 7.82.0 *_0
- gtest
- gmock
- cpp-filesystem >=1.5.8
- cpp-expected
- reproc-cpp
- yaml-cpp
Expand Down
1 change: 0 additions & 1 deletion micromamba/environment-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ dependencies:
- libcurl 7.82.0 *_0
- gtest
- gmock
- cpp-filesystem >=1.5.8
- cpp-expected
- reproc-cpp
- yaml-cpp
Expand Down

0 comments on commit f80df10

Please sign in to comment.