-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprofile
59 lines (46 loc) · 1.29 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
#!/bin/sh
# gpgconf --launch gpg-agent
# export SSH_AUTH_SOCKET=$HOME/.gnupg/S.gpg-agent.ssh
# export SSH_AUTH_SOCK=$HOME/.gnupg/S.gpg-agent.ssh
[ ! -r "/etc/profile" ] || . "/etc/profile"
# =======================
# inlude other conf files
# =======================
for file in $HOME/.profile.d/*; do
if [ -x "$file" ]; then
. "$file"
fi
done
# ============
# update paths
# ============
# ==> setup PATH variable
pathmunge () {
case ":${PATH}:" in
*:"$1":*)
;;
*)
if [ "$2" = "after" ] ; then
PATH="${PATH:+"$PATH:"}$1"
else
PATH="$1${PATH:+":$PATH"}"
fi
esac
}
[ ! -d "$SCRIPTS_DIR" ] || pathmunge "$SCRIPTS_DIR"
# ==> generic
[ ! -d "$HOME/.local/bin" ] || pathmunge "$HOME/.local/bin"
# ==> rust
[ ! -d "$HOME/.cargo/bin" ] || pathmunge "$HOME/.cargo/bin"
# ==> python
export PYTHONUSERBASE=${PYTHONUSERBASE:-"$HOME/.local"}
[ ! -d "$PYTHONUSERBASE/bin" ] || pathmunge "$PYTHONUSERBASE/bin"
[ ! -d "$HOME/.poetry/bin" ] || pathmunge "$HOME/.poetry/bin"
export PYENV_ROOT="$HOME/.pyenv"
[ ! -d "$PYENV_ROOT/bin" ] || pathmunge "$PYENV_ROOT/bin"
# ==> npm
export npm_config_prefix="$XDG_DATA_HOME/npm"
export npm_config_cache="$XDG_CACHE_HOME/npm"
[ ! -d "$npm_config_prefix" ] || pathmunge "$npm_config_prefix/bin"
unset pathmunge
export PATH