Skip to content

Commit

Permalink
fix: Use POSIX-compliant scripts
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Jerphanion <[email protected]>
  • Loading branch information
jjerphan committed Oct 11, 2024
1 parent 76570f8 commit 2ec0a1b
Showing 1 changed file with 16 additions and 7 deletions.
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

0 comments on commit 2ec0a1b

Please sign in to comment.