-
Notifications
You must be signed in to change notification settings - Fork 78
/
.envrc
45 lines (36 loc) · 941 Bytes
/
.envrc
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
set +u
[ -f "$HOME/.envrc" ] && source_env $HOME || true
export_alias() {
local name=$1
shift
local alias_dir=$PWD/.direnv/aliases
local target="$alias_dir/$name"
mkdir -p "$alias_dir"
PATH_add "$alias_dir"
echo "#!/usr/bin/env bash" > "$target"
echo "set -e" >> "$target"
echo "$@ \"\$@\"" >> "$target"
chmod +x "$target"
}
export_function() {
local name=$1
local alias_dir=$PWD/.direnv/aliases
mkdir -p "$alias_dir"
PATH_add "$alias_dir"
local target="$alias_dir/$name"
if declare -f "$name" >/dev/null; then
echo "#!/usr/bin/env bash" > "$target"
declare -f "$name" >> "$target" 2>/dev/null
echo "$name" >> "$target"
chmod +x "$target"
fi
}
export PROJECT_NAME=keepa
export PYENV_VIRTUALENV_DISABLE_PROMPT=1
PATH_add "$PWD"
PYENV_ROOT=$(pyenv root)
if [[ -d "${PYENV_ROOT}/versions/$PROJECT_NAME" ]]; then
eval "$(pyenv init -)"
pyenv activate $PROJECT_NAME
fi
unset PS1