-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdot.bash_profile
More file actions
44 lines (35 loc) · 874 Bytes
/
dot.bash_profile
File metadata and controls
44 lines (35 loc) · 874 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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# bash_profile
# set PATH
mergepath() {
local directory="$1"
local before_or_after="$2"
if ! echo ":${PATH}:" | /bin/fgrep ":${directory}:" > /dev/null 2>&1 ; then
# "directory" doesn't exist in PATH
if [ "${before_or_after}" == "before" ]; then
PATH="${directory}:${PATH}"
else
PATH="${PATH}:${directory}"
fi
export PATH
fi
}
if [ -d "${HOME}/bin" ]; then
mergepath "${HOME}/bin" "after"
fi
# for java
if [ -d "/usr/java/default" ]; then
export JAVA_HOME="/usr/java/default"
mergepath "${JAVA_HOME}/bin" "before"
fi
unset -f mergepath
unset USERNAME
# anyenv / nodenv
if [[ -d "$HOME/.anyenv" ]] ; then
export PATH="$HOME/.anyenv/bin:$PATH"
eval "$(anyenv init - bash)"
fi
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# vim:set ft=sh: