Skip to content

Commit

Permalink
Merge branch 'main' into nushell
Browse files Browse the repository at this point in the history
  • Loading branch information
cvanelteren authored Aug 28, 2023
2 parents e616dfb + 65c061f commit fca3e69
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
6 changes: 6 additions & 0 deletions libmamba/include/mamba/core/mamba_fs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,12 @@ namespace fs
return this->wstring();
}

// Returns an utf-8 string using the ``/`` on all systems.
std::string generic_string() const
{
return to_utf8(m_path.generic_string());
}

// Implicit conversion to standard path.
operator std::filesystem::path() const
{
Expand Down
12 changes: 8 additions & 4 deletions libmamba/src/core/shell_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,19 +568,22 @@ namespace mamba
if (shell == "zsh" || shell == "bash" || shell == "posix")
{
std::string contents = data_micromamba_sh;
util::replace_all(contents, "$MAMBA_EXE", exe.string());
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
return contents;
}
else if (shell == "csh")
{
std::string contents = data_micromamba_csh;
util::replace_all(contents, "$MAMBA_EXE", exe.string());
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
return contents;
}
else if (shell == "xonsh")
{
std::string contents = data_mamba_xsh;
util::replace_all(contents, "$MAMBA_EXE", exe.string());
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
return contents;
}
else if (shell == "powershell")
Expand All @@ -606,7 +609,8 @@ namespace mamba
else if (shell == "fish")
{
std::string contents = data_mamba_fish;
util::replace_all(contents, "$MAMBA_EXE", exe.string());
// Using /unix/like/paths on Unix shell (even on Windows)
util::replace_all(contents, "$MAMBA_EXE", exe.generic_string());
return contents;
}
// deprecated according to https://github.com/mamba-org/mamba/pull/2693
Expand Down

0 comments on commit fca3e69

Please sign in to comment.