-
Notifications
You must be signed in to change notification settings - Fork 1
/
.profile
102 lines (84 loc) · 2.12 KB
/
.profile
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
add_to_path() {
new_path="$1"
if [ -d "$new_path" ]; then
PATH="$new_path:$PATH"
fi
}
configure_rbenv_ish() {
dir="$1"
command="$2"
add_to_path "$dir/bin"
if [ -d "$dir/plugins" ]; then
for plugin_dir in "$dir/plugins"; do
add_to_path "$plugin_dir/bin"
done
fi
if [ -n "$command" ]; then
if command -v "$command" > /dev/null 2>&1; then
eval "$("$command" init -)"
fi
fi
}
if [ -f "$HOME/.env" ]; then
. "$HOME/.env"
fi
path_without_brew="$PATH"
if [ -d "$HOME/.linuxbrew" ]; then
eval "$("$HOME/.linuxbrew/bin/brew" shellenv)"
fi
if [ -d '/home/linuxbrew/.linuxbrew' ]; then
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
fi
if [ -d '/opt/homebrew' ]; then
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
PATH="$path_without_brew:$PATH" # Move Homebrew to end of `PATH`
if [ -d "$HOME/.nvm" ]; then
export NVM_DIR="$HOME/.nvm"
if [ -s "$NVM_DIR/nvm.sh" ]; then
. "$NVM_DIR/nvm.sh"
fi
fi
configure_rbenv_ish "$HOME/.erlenv" erlenv
configure_rbenv_ish "$HOME/.exenv" exenv
configure_rbenv_ish "$HOME/.jenv" jenv
configure_rbenv_ish "$HOME/.pyenv"
if command -v pyenv > /dev/null 2>&1; then
eval "$(pyenv init --path)"
if [ -d "$PYENV_ROOT/plugins/pyenv-virtualenv" ]; then
eval "$(pyenv virtualenv-init -)"
fi
fi
configure_rbenv_ish "$HOME/.nodenv" nodenv
configure_rbenv_ish "$HOME/.rbenv" rbenv
add_to_path "$HOME/.asdf/bin"
if which asdf > /dev/null 2>&1; then
case "$(which asdf)" in
"$(brew --prefix)"/*)
. "$(brew --prefix asdf)/libexec/asdf.sh"
;;
*)
. "$(realpath "$(dirname "$(realpath "$(which asdf)")")/../libexec/asdf.sh")"
;;
esac
fi
add_to_path "$HOME/.yarn/bin"
add_to_path "$HOME/.local/bin"
add_to_path "$HOME/bin"
if command -v pathmerge > /dev/null 2>&1; then
# http://membled.com/work/apps/pathmerge/
export PATH="$(pathmerge "$PATH")"
fi
if [ -n "$XDG_DATA_DIRS" ]; then
if [ -d "$HOME/.local/share" ]; then
XDG_DATA_DIRS="$HOME/.local/share:$XDG_DATA_DIRS"
fi
if command -v pathmerge > /dev/null 2>&1; then
export XDG_DATA_DIRS="$(pathmerge "$XDG_DATA_DIRS")"
fi
fi
if [ -n "$BASH_VERSION" ]; then
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
fi