-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup_path
37 lines (33 loc) · 1.01 KB
/
setup_path
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
add_to_path() {
path="$1"
if [ -d "$path" ]; then
case "$PATH" in
*:$path:*|*:$path|$path:*)
return
;;
esac
PATH="$path":"$PATH"
fi
}
# Set up $PATH appropriately, using user's private bin if it exists,
# plus any contrib directories that exist in user's private bin,
# plus any bin/ directories that compiled software might exist in.
PRIVATE_BIN="$HOME/etc/bin"
if [ -d "$PRIVATE_BIN/contrib/" ] ; then
for contrib_dir in "$PRIVATE_BIN"/contrib/*; do
add_to_path "$contrib_dir"
add_to_path "$contrib_dir"/bin
done
fi
# ~/local is a mistake, should move to ~/.local
for bin in "$PRIVATE_BIN" "$HOME"/.gem/ruby/*/bin "$HOME"/.cabal/bin \
"$HOME"/.local/bin "$HOME"/local/bin; do
add_to_path "$bin"
done
for bin in /opt/*/bin /opt/*/*/bin; do
add_to_path "$bin"
done
# Seems like I don't actually need this; pip install --user does the
# right thing?
#PYTHONPATH=~/.local/lib/python2.7/site-packages
#export PYTHONPATH