-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathset-up-dev.sh
More file actions
109 lines (98 loc) · 2.32 KB
/
Copy pathset-up-dev.sh
File metadata and controls
109 lines (98 loc) · 2.32 KB
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
function pretty_print(){
tput setaf 1; echo $1
}
function is_app_installed(){
if ls /Applications/ | grep -i $1 > /dev/null; then
return 0;
else
return 1;
fi
}
function setup_brew(){
if ! command -v brew > /dev/null; then
pretty_print "Installing brew"
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
pretty_print "Brew is already installed"
fi
}
function install_vim(){
if ! command -v vim > /dev/null; then
pretty_print "Installing vim"
brew install vim
else
pretty_print "Vim is already installed"
fi
}
function setup_git(){
if ! command -v git > /dev/null; then
pretty_print "Install git"
brew install git
else
pretty_print "git is already installed"
fi
}
function configure_git(){
pretty_print "Configuring git"
pretty_print "Enter Username"
read user_name
git config --global user.name $username
pretty_print "Configure git email"
read user_email
git config --global user.email $username
pretty_print "Configuring vim as editor"
git config --global core.editor vim
pretty_print "Push behavior"
git config --global push.default current
git config --list
}
function setup_vimrc(){
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.s
}
function install_iterm(){
echo "Setup Iterm"
is_app_installed iterm
if [[ "$?" = 0 ]]; then
echo "iterm already installed"
else
brew cask install iterm2
fi
}
function setup_zsh(){
which zsh
if [[ "$?" = 0 ]]; then
echo "zsh is already installed"
else
brew install zsh
fi
brew install zsh-completions
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
sudo chsh -s $(which zsh)
}
function setup_python3(){
if ! command -v python3 >/dev/null; then
brew install python3
else
pretty_print "Python3 is already installed"
fi
pip3 install virtualenv --user
pip3 install pipenv --user
}
function setup_virtualenv_for_python2(){
pip install virtualenv --user
pip install pipenv --user
}
setup_brew
brew update
install_vim
setup_git
pretty_print "Want to configure git y/n?"
read option
if [[ "$option" = "y" ]]; then
configure_git
fi
install_iterm
setup_zsh
setup_python3
setup_virtualenv_for_python2