-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdirenvrc
More file actions
25 lines (22 loc) · 773 Bytes
/
direnvrc
File metadata and controls
25 lines (22 loc) · 773 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# required for things to work - copied directly from direnv
direnv_layout_dir() {
echo "${direnv_layout_dir:-$PWD/.direnv}"
}
########## https://github.com/direnv/direnv/issues/1072
layout_mamba() {
# initialize micromamba
eval "$(micromamba shell hook --shell=bash)"
# check if environment name is specified
if [ -n "$1" ]; then
# Explicit environment name from layout command.
local env_name="$1"
# activate environment
micromamba activate ${env_name}
elif (grep -q name: environment.yml 2> /dev/null); then
# Detect environment name from `environment.yml` file in `.envrc` directory
micromamba activate `grep name: environment.yml | sed -e 's/name: //'`
else
# activate base environment
micromamba activate base;
fi;
}