Files
Mini-Nav/.envrc

43 lines
1.4 KiB
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
export DIRENV_WARN_TIMEOUT=20s
# 尝试加载 devenv 的 direnv 配置
if command -v devenv >/dev/null 2>&1; then
# 如果存在 devenv
eval "$(devenv direnvrc)"
# `use devenv` 支持和 `devenv shell` 相同的选项
# 示例use devenv --quiet --impure --option services.postgres.enable:bool true
use devenv
else
# 如果不存在 devenv则加载自己的 fallback 配置
echo "devenv not found, loading fallback configuration..."
export UV_PROJECT_ENVIRONMENT="/workspace/envs/mini-nav"
export MY_DEV_ENV=1
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
# if all else fails, activate base environment
micromamba activate base;
fi;
}
layout mamba
# Static Link Libraries
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib:$LD_LIBRARY_PATH
fi