Use direnv to automatically activate a mamba environment. Assumes that micromamba executable is in the $PATH. The contents of .direnvrc goes in either ~/.direnvrc or ~/direnv/direnvrc.
Tested with bash and fish shells.
Requires .envrc file in the directory where mamba is to be activated and should contain:
layout mamba [environment-name]
- If
environment-nameis supplied thenenvironment-nameis activated. - If
environment-nameis not supplied andenvironment.ymlexists and containsname:then the environment specified is activated. - If
environment-nameis not supplied andenvironment.ymldoes not exist or exists but does not containname:then thebaseenvironment is activated.