-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup
executable file
·187 lines (154 loc) · 4.05 KB
/
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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#!/usr/bin/env bash
DIRNAME=$(dirname $0)
DEPENDENCIES=('git' 'curl' 'zsh' 'tmux' 'vim' 'emacs' 'tree', 'ripgrep', 'ghostty')
[ $(uname -s) = 'Darwin' ] && IS_MAC=1 || IS_MAC=0
if [ $IS_MAC = 1 ]; then
PACKAGE_MGR='brew'
DEPENDENCIES+=('reattach-to-user-namespace' 'the_silver_searcher' 'zsh-completions' 'gnupg2' 'bat' 'exa' 'k9s' 'jq')
cat $DIRNAME/.aliases/osx $DIRNAME/.aliases/shared >$HOME/.aliases
else
PACKAGE_MGR='sudo apt-get -y'
# Requires Ubuntu > 13.10
DEPENDENCIES+=('silversearcher-ag')
cat $DIRNAME/.aliases/linux $DIRNAME/.aliases/shared >$HOME/.aliases
fi
echo -e "\033[0;34mInstalling dependencies...\033[0m"
function check_dependency {
if [ $IS_MAC = 1 ]; then
brew list $1 >>/dev/null 2>&1
test $? -eq 0
else
sudo dpkg-query -L $1 >>/dev/null 2>&1
fi
}
function install_dependency {
echo -e "\033[0;34mInstalling $1...\033[0m"
check_dependency $1 || $PACKAGE_MGR install $1
}
for dependency in ${DEPENDENCIES[@]}; do
install_dependency $dependency
done
echo -e "\033[0;34mSetting up Vundle...\033[0m"
if [ -d $HOME/.vim/bundle/Vundle.vim ]; then
(
cd $HOME/.vim/bundle/Vundle.vim
git pull -q
)
else
git clone https://github.com/gmarik/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim
fi
(
cd $HOME
vim +PluginInstall +qall
)
echo -e "\033[0;34mSetting up fzf...\033[0m"
mkdir -p $HOME/.shadowboxes $HOME/bin $HOME/man
if [ -d $HOME/.shadowboxes/fzf ]; then
(
cd $HOME/.shadowboxes/fzf
git pull -q
)
else
git clone https://github.com/junegunn/fzf.git $HOME/.shadowboxes/fzf
fi
echo -e "\033[0;34mSetting up z...\033[0m"
mkdir -p $HOME/.shadowboxes $HOME/bin $HOME/man
if [ -d $HOME/.shadowboxes/z ]; then
(
cd $HOME/.shadowboxes/z
git pull -q
)
else
git clone https://github.com/rupa/z.git $HOME/.shadowboxes/z
(
cd $HOME/bin
ln -s $HOME/.shadowboxes/z/z.sh z.sh
)
(
cd $HOME/man
ln -s $HOME/.shadowboxes/z/z.1 z.1
)
touch $HOME/.z
source $HOME/bin/z.sh
fi
echo -e "\033[0;34mSetting up n...\033[0m"
if [ -d $HOME/.shadowboxes/n ]; then
(
cd $HOME/.shadowboxes/n
git pull -q
)
else
git clone https://github.com/tj/n.git $HOME/.shadowboxes/n
(
cd $HOME/.shadowboxes/n
PREFIX=$HOME make install
)
fi
echo -e "\033[0;34mSetting up ruby-install...\033[0m"
if [ -d $HOME/.shadowboxes/ruby-install ]; then
(
cd $HOME/.shadowboxes/ruby-install
git pull -q
)
else
git clone https://github.com/postmodern/ruby-install.git $HOME/.shadowboxes/ruby-install
(
cd $HOME/.shadowboxes/ruby-install
sudo make install
)
fi
echo -e "\033[0;34mSetting up chruby...\033[0m"
if [ -d $HOME/.shadowboxes/chruby ]; then
(
cd $HOME/.shadowboxes/chruby
git pull -q
)
else
git clone https://github.com/postmodern/chruby.git $HOME/.shadowboxes/chruby
(
cd $HOME/.shadowboxes/chruby
sudo make install
)
fi
echo -e "\033[0;34mSetting up ix...\033[0m"
if [ ! -f $HOME/bin/ix ]; then
curl ix.io/client >$HOME/bin/ix
chmod +x $HOME/bin/ix
fi
rsync --exclude ".git/" \
--exclude ".DS_Store" \
--exclude ".aliases" \
--exclude ".fonts" \
--exclude "README.md" \
--exclude "ETC.md" \
--exclude "Dockerfile" \
--exclude "images" \
--exclude "install" \
--exclude "setup" \
--exclude "vm" \
-av --no-perms -q "$(dirname $0)/" $HOME
$HOME/.shadowboxes/fzf/install --all
if [ $IS_MAC = 1 ]; then
echo -e "\033[0;34mSetting up fonts...\033[0m"
cp .fonts/*.otf /Library/Fonts/
if [ -d $HOME/.shadowboxes/iTerm2-Color-Schemes ]; then
(
cd $HOME/.shadowboxes/iTerm2-Color-Schemes
git pull -q
)
else
git clone https://github.com/mbadolato/iTerm2-Color-Schemes.git $HOME/.shadowboxes/iTerm2-Color-Schemes
fi
CASKS=('1password' 'alfred' 'divvy' 'docker' 'google-chrome' 'iTerm2' 'licecap' 'spotify' 'superhuman' 'visual-studio-code')
function check_cask {
brew list $1 >>/dev/null 2>&1
test $? -eq 0
}
function install_cask {
echo -e "\033[0;34mInstalling $1...\033[0m"
check_cask $1 || brew install $1
}
for cask in ${CASKS[@]}; do
install_cask $cask
done
fi