Fix micromamba activate on Windows (#3484)

Fixed mamba_hook.bat
This commit is contained in:
Johan Mabille 2024-09-30 16:06:13 +02:00 committed by GitHub
parent 79034ebff1
commit 2e8b3ee7bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 7 deletions

View File

@ -13,13 +13,15 @@ __MAMBA_INSERT_MAMBA_EXE__
@SET __mambabin_dir=
@SET __mamba_root=
@echo off
@REM We need to define an alias with the same name as the executable to be called by the user.
@REM Get the base filename of MAMBA_EXE
@FOR %%A in ("%MAMBA_EXE%") do set "__mamba_filename=%%~nxA"
@REM Remove .exe extension from the filename
@SET "__mamba_name=!__mamba_filename:%~x1=!"
@REM Define correct alias depending on the executable name
@set "__mamba_cmd=call ""%MAMBA_BAT%"" $*"
@DOSKEY !__mamba_name!=!__mamba_cmd!
@FOR %%A in ("%MAMBA_EXE%") do (
@set "__mamba_filename=%%~nxA"
@REM Remove .exe extension from the filename
@SET "__mamba_name=!__mamba_filename:%~x1=!"
@REM Define correct alias depending on the executable name
@set "__mamba_cmd=call ""%MAMBA_BAT%"" $*"
@DOSKEY !__mamba_name!=!__mamba_cmd!
)
@SET CONDA_SHLVL=0