Skip to content

Commit

Permalink
Fix path spearator on Win Posix shells
Browse files Browse the repository at this point in the history
  • Loading branch information
AntoinePrv committed Sep 1, 2023
1 parent c51ce62 commit 448b2ff
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions libmamba/src/core/shell_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "mamba/core/util.hpp"
#include "mamba/core/util_os.hpp"
#include "mamba/util/build.hpp"
#include "mamba/util/path_manip.hpp"
#include "mamba/util/string.hpp"

namespace mamba
Expand Down Expand Up @@ -533,21 +534,21 @@ namespace mamba
{
std::string contents = data_micromamba_sh;
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
util::replace_all(contents, "$MAMBA_EXE", util::path_to_posix(exe.string()));
return contents;
}
else if (shell == "csh")
{
std::string contents = data_micromamba_csh;
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
util::replace_all(contents, "$MAMBA_EXE", util::path_to_posix(exe.string()));
return contents;
}
else if (shell == "xonsh")
{
std::string contents = data_mamba_xsh;
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
util::replace_all(contents, "$MAMBA_EXE", util::path_to_posix(exe.string()));
return contents;
}
else if (shell == "powershell")
Expand All @@ -574,7 +575,7 @@ namespace mamba
{
std::string contents = data_mamba_fish;
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
util::replace_all(contents, "$MAMBA_EXE", util::path_to_posix(exe.string()));
return contents;
}
return "";
Expand Down

0 comments on commit 448b2ff

Please sign in to comment.