Skip to content

Commit

Permalink
Update shell hook comments (#3051)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag authored Dec 19, 2023
1 parent 57a6a69 commit 443c3e3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions libmamba/src/core/shell_init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ namespace mamba
std::string cyg_mamba_exe = native_path_to_unix(mamba_exe.string());
std::string cyg_env_prefix = native_path_to_unix(env_prefix.string());
content << "\n# >>> mamba initialize >>>\n";
content << "# !! Contents within this block are managed by 'mamba init' !!\n";
content << "# !! Contents within this block are managed by 'micromamba shell init' !!\n";
content << "export MAMBA_EXE=" << std::quoted(cyg_mamba_exe, '\'') << ";\n";
content << "export MAMBA_ROOT_PREFIX=" << std::quoted(cyg_env_prefix, '\'') << ";\n";
content << "eval \"$(\"$MAMBA_EXE\" shell hook --shell " << shell
Expand All @@ -308,15 +308,15 @@ namespace mamba
return fmt::format(
"\n"
"# >>> mamba initialize >>>\n"
"# !! Contents within this block are managed by 'mamba init' !!\n"
"# !! Contents within this block are managed by 'micromamba shell init' !!\n"
"export MAMBA_EXE={mamba_exe_path};\n"
"export MAMBA_ROOT_PREFIX={root_prefix};\n"
R"sh(__mamba_setup="$("$MAMBA_EXE" shell hook --shell {shell} --root-prefix "$MAMBA_ROOT_PREFIX" 2> /dev/null)")sh"
"\n"
"if [ $? -eq 0 ]; then\n"
" eval \"$__mamba_setup\"\n"
"else\n"
R"sh( alias {mamba_exe_name}="$MAMBA_EXE" # Fallback on help from mamba activate)sh"
R"sh( alias {mamba_exe_name}="$MAMBA_EXE" # Fallback on help from micromamba activate)sh"
"\n"
"fi\n"
"unset __mamba_setup\n"
Expand Down Expand Up @@ -346,7 +346,7 @@ namespace mamba
}

content << "\n# >>> mamba initialize >>>\n";
content << "# !! Contents within this block are managed by 'mamba init' !!\n";
content << "# !! Contents within this block are managed by 'micromamba shell init' !!\n";
content << "$MAMBA_EXE = " << mamba_exe << "\n";
content << "$MAMBA_ROOT_PREFIX = " << env_prefix << "\n";
content << "import sys as _sys\n";
Expand Down Expand Up @@ -378,7 +378,7 @@ namespace mamba
}

content << "\n# >>> mamba initialize >>>\n";
content << "# !! Contents within this block are managed by 'mamba init' !!\n";
content << "# !! Contents within this block are managed by 'micromamba shell init' !!\n";
content << "set -gx MAMBA_EXE " << mamba_exe << "\n";
content << "set -gx MAMBA_ROOT_PREFIX " << env_prefix << "\n";
content << "$MAMBA_EXE shell hook --shell fish --root-prefix $MAMBA_ROOT_PREFIX | source\n";
Expand All @@ -401,7 +401,7 @@ namespace mamba
}

content << "\n# >>> mamba initialize >>>\n";
content << "# !! Contents within this block are managed by 'mamba init' !!\n";
content << "# !! Contents within this block are managed by 'micromamba shell init' !!\n";
content << "$env.MAMBA_EXE = " << mamba_exe << "\n";
content << "$env.MAMBA_ROOT_PREFIX = " << env_prefix << "\n";
content << "$env.PATH = ($env.PATH | append ([$env.MAMBA_ROOT_PREFIX bin] | path join) | uniq)\n";
Expand Down Expand Up @@ -468,7 +468,7 @@ def --env "micromamba deactivate" [] {
}

content << "\n# >>> mamba initialize >>>\n";
content << "# !! Contents within this block are managed by 'mamba init' !!\n";
content << "# !! Contents within this block are managed by 'micromamba shell init' !!\n";
content << "setenv MAMBA_EXE " << mamba_exe << ";\n";
content << "setenv MAMBA_ROOT_PREFIX " << env_prefix << ";\n";
content << "source $MAMBA_ROOT_PREFIX/etc/profile.d/micromamba.csh;\n";
Expand Down

0 comments on commit 443c3e3

Please sign in to comment.