forked from tessie/setup-mac-dev
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathset-up-dev
More file actions
113 lines (101 loc) · 2.36 KB
/
set-up-dev
File metadata and controls
113 lines (101 loc) · 2.36 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
110
111
112
113
#!/bin/sh
pretty_print() {
tput setaf 1
echo "$1"
}
install() {
if ! command -v "$1" >/dev/null; then
pretty_print "Installing $1"
brew install "$1" --"$2"
else
pretty_print "$1 is already installed"
fi
}
append_to_zshrc() {
if ! grep "$1" "$HOME"/.zshrc >/dev/null; then
echo "$1" >>~/.zshrc
fi
}
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
}
setup_vimrc() {
git clone --depth=1 https://github.com/amix/vimrc.git ~/.vim_runtime
sh ~/.vim_runtime/install_awesome_vimrc.s
}
setup_zsh() {
install zsh
if [ ! -d /Users/tessie/.oh-my-zsh ]; then
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
fi
if [ "$(command -v zsh)" != '/usr/local/bin/zsh' ]; then
shell_path="$(command -v zsh)"
if ! grep "$shell_path" /etc/shells >/dev/null 2>&1; then
pretty_print "Adding '$shell_path' to /etc/shells"
sudo sh -c "echo $shell_path >> /etc/shells"
fi
sudo chsh -s "$shell_path" "$USER"
fi
if [ ! -d ~/.zsh/zsh-autosuggestions ]; then
git clone https://github.com/zsh-users/zsh-autosuggestions ~/.zsh/zsh-autosuggestions
append_to_zshrc "source ~/.zsh/zsh-autosuggestions/zsh-autosuggestions.zsh"
fi
}
setup_python3() {
install python3
if ! pip3 show pipenv >/dev/null; then
pip3 install pipenv --user
fi
}
setup_python2() {
if ! command -v pip >/dev/null; then
pretty_print "Setting up pip"
sudo easy_install pip
fi
if ! pip show pipenv >/dev/null; then
pip install pipenv --user
fi
}
install_rbenv() {
install rbenv
eval "$(rbenv init -)"
}
setup_rust() {
if ! command rustc --version >/dev/null; then
curl https://sh.rustup.rs -sSf | sh
append_to_zshrc "source $HOME/.cargo/env"
fi
}
setup_javascript_packages() {
install yarn --without-node
install node
}
setup_brew
brew update
brew upgrade --all
install vim
install git
install wget --with-iri
install imagemagick --with-webp
install rename
install tree
install jq
setup_zsh
setup_python3
setup_python2
install pyenv
install_rbenv
setup_javascript_packages
setup_rust
brew cask upgrade
brew cask install iterm2
brew cask install firefox
brew cask install visual-studio-code
brew cask install docker
brew cask install rubymine
brew cask install webstorm