-
Notifications
You must be signed in to change notification settings - Fork 0
/
.commonenv
130 lines (114 loc) · 3.35 KB
/
.commonenv
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
UNAME=$(uname)
source $HOME/.commonfuncs
# let's set a proper PATH
#########################
# This is an attempt to use a fancy path generator
# like the one in .zshenv
new_path=""
expected_path=(
"$HOME/bin/$MACHTYPE-$OSTYPE"
"$HOME/bin"
"$HOME/bin/git_achievements"
"$HOME/.gem/ruby/1.8/bin"
/opt/local/apache2/bin
/opt/python/bin
/opt/python-build/python-2.7/bin
/opt/python-build/python-2.6/bin
/opt/python-build/python-2.5/bin
/opt/python-build/python-2.4/bin
/opt/local/bin
/opt/local/sbin
/opt/local/lib/postgresql91/bin
/opt/local/lib/postgresql90/bin
/opt/local/lib/postgresql83/bin
/opt/local/lib/mysql55/bin
/opt/local/lib/mysql5/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.5/bin
/opt/local/Library/Frameworks/Python.framework/Versions/2.4/bin
/sw/bin
/sw/sbin
/usr/bin/perlbin/site
/usr/bin/perlbin/vendor
/usr/bin/perlbin/core
/usr/local/Cellar/python/2.7/bin
/usr/local/Cellar/python/2.6/bin
/usr/local/Cellar/python/2.5/bin
/usr/local/Cellar/python/2.4/bin
/usr/local/bin
/usr/local/sbin
/usr/local/etc
/usr/local/share/python
/usr/local/share/python3
/usr/Programs/bin
/sbin
/bin
/usr/bin
/usr/sbin
/usr/ucb
/usr/bsd
/usr/libexec
/Developer/Tools
/opt/ruby1.8/bin
/usr/local/contrib/lib/kde/bin
/usr/local/tex/bin
/usr/local/lib/zsh/scr
/usr/local/games
/usr/games
/etc
)
for element in "${expected_path[@]}"
do
if [ -d $element ]; then
if [ -z $new_path ]; then
new_path=$element
else
new_path=$new_path:$element
fi
fi
done
PATH=$new_path:$PATH
export PATH
# Enable a few things for less (This will also apply to man)
# * turn off case sensitive search (-I)
# * display a long prompt with more info (-M)
# * show colors instead of escape characters (-R)
export LESS="-IMR"
# conditionally set the editor variable
if checkPath mate_wait; then
# to set this up you need to symlink the mate command
# $ cd ~/bin
# $ ln -s /path/to/mate mate_wait
export EDITOR='mate_wait'
else
export EDITOR=vi
fi
# use a fancy terminal
export TERM=xterm-256color
# get crazy with python, and the cheese whiz
#export PYTHONSTARTUP=$HOME/.pystartup
# prefer to use distribute for virtualenvs
export VIRTUALENV_USE_DISTRIBUTE="TRUE"
# add our public repo to the pip find links
export PIP_DOWNLOAD_CACHE="$HOME/.pip_download_cache"
# set up some more OS X specific stuff
if [ $UNAME = "Darwin" ]; then
# Figure out the major and minor version of OS X
os_majorversion=$(sw_vers | awk '/ProductVersion/ {print $2}' | cut -f2 -d'.')
os_minorversion=$(sw_vers | awk '/ProductVersion/ {print $2}' | cut -f3 -d'.')
# to not tar up resource forks, you'll need this
if [ $os_majorversion -ge 5 ]; then
# Leopard version (and beyond??)
export COPYFILE_DISABLE="True"
elif [ ${os_majorversion} -eq 4 ] && [ ${os_minorversion} -ge 6 ]; then
# Tiger version
export COPY_EXTENDED_ATTRIBUTES_DISABLE="True"
fi
fi
if [ -e '/usr/local/share/python/virtualenvwrapper.sh' ]; then
source /usr/local/share/python/virtualenvwrapper.sh
fi
if [ -e '/usr/local/share/python3/virtualenvwrapper.sh' ]; then
source /usr/local/share/python3/virtualenvwrapper.sh
fi