-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathcommon-setup
46 lines (38 loc) · 1.01 KB
/
common-setup
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
bash_reload=false
if [[ "$HOME" = "/home/awdwr" ]]; then
awdwr='/home/awdwr/git/awdwr'
else
awdwr=$HOME
fi
# testrails alias
if ! grep -q 'alias testrails=' ~/.bashrc ; then
echo "alias testrails='ruby $awdwr/testrails.rb'" >> ~/.bashrc
bash_reload=true
fi
# work alias
if ! grep -q 'alias work=' ~/.bashrc ; then
echo "alias work='source $awdwr/vagrant/bin/work'" >> ~/.bashrc
bash_reload=true
fi
# depot alias
if ! grep -q 'alias depot=' ~/.bashrc ; then
echo "alias depot='bash $awdwr/vagrant/bin/depot'" >> ~/.bashrc
bash_reload=true
fi
# reload bash if needed
if [ "$bash_reload" = true ] ; then
source ~/.bashrc
fi
# run setup
if [[ ! -e ~/git/gorp ]]; then
(cd ~/git/awdwr; ruby setup.rb)
fi
# install gems
if [[ ! -e $/git/awdwr/Gemfile.lock ]]; then
(cd ~/git/awdwr; bundle update)
fi
# configure a dummy git user
if [[ -z "$(git config --get-regexp user.*)" ]]; then
git config --global user.name "Agile Web Development with Rails"
git config --global user.email [email protected]
fi