Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Use POSIX-compliant scripts #3522

Merged
merged 4 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions libmamba/data/mamba.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,22 @@ __mamba_wrap() {
# There is no way to register it dynamically without relying on hacks or eval.
__exe_name="$(basename "${MAMBA_EXE}")"
__exe_name="${__exe_name%.*}"
if [[ "${__exe_name}" == "micromamba" ]]; then
micromamba() { __mamba_wrap "${@}"; }
elif [[ "${__exe_name}" == "mamba" ]]; then
mamba() { __mamba_wrap "${@}"; }
else
echo "Error unknow MAMBA_EXE: \"${MAMBA_EXE}\", filename must be mamba or micromamba" 1>&2
fi

case "${__exe_name}" in
micromamba)
micromamba() {
__mamba_wrap "$@"
}
;;
mamba)
mamba() {
__mamba_wrap "$@"
}
;;
*)
echo "Error unknown MAMBA_EXE: \"${MAMBA_EXE}\", filename must be mamba or micromamba" 1>&2
;;
esac


if [ -z "${CONDA_SHLVL+x}" ]; then
Expand Down
2 changes: 2 additions & 0 deletions micromamba/tests/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,8 @@ def test_env_update_conda_forge_with_pypi(tmp_home, tmp_root_prefix, tmp_path):
channels:
- conda-forge
dependencies:
# This version of Python covers all the versions of numpy available on conda-forge and PyPI for all platforms.
- python 3.12
- pip
- pip:
- numpy==1.26.4
Expand Down
Loading