-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-stuff.sh
More file actions
executable file
·175 lines (138 loc) · 3.35 KB
/
install-stuff.sh
File metadata and controls
executable file
·175 lines (138 loc) · 3.35 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
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
#!/usr/bin/env bash
set -o pipefail
set -e
init() {
OS="$(/usr/bin/uname)"
PLATFORM="$(/usr/bin/uname -m)"
if [[ "${OS}" == "Linux" ]]
then
ON_LINUX=1
elif [[ "${OS}" == "Darwin" ]]
then
ON_MACOS=1
else
echo "This script currently supports only MacOs and Linux. If on Windows use WSL." && exit 1
fi
}
check_if_dir_exists() {
[[ -d "$1" ]] && echo "true" || echo "false"
}
check_if_file_exists() {
[[ -f "$1" ]] && echo "true" || echo "false"
}
banner_pre() {
echo "
*************************
Installing $1 ...
*************************
"
}
banner_post() {
echo "
*************************
Done with installing $1 ✅
*************************
"
}
banner_skip() {
echo "
*************************
$1 is already installed! ✅
*************************
"
}
init
# Install Brew
banner_pre 'Homebrew'
if [[ -n "${ON_LINUX}" ]]
then
if [[ "$(check_if_dir_exists '/home/linuxbrew/.linuxbrew')" == "false" ]]
then
echo "$(check_if_dir_exists '/home/linuxbrew/.linuxbrew')"
INSTALL_BREW=1
else
if [[ "${PLATFORM}" == "arm64" ]]
then
if [[ "$(check_if_dir_exists '/opt/homebrew')" == "false" ]]
then
INSTALL_BREW=1
else
banner_skip 'Homebrew'
fi
else
if [[ "$(check_if_dir_exists '/usr/local/Homebrew')" == "false" ]]
then
INSTALL_BREW=1
else
banner_skip 'Homebrew'
fi
fi
fi
fi
[ -n "${INSTALL_BREW}" ] && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" && banner_post 'Homebrew'
# Install OMZ if not already
banner_pre 'Oh My Zsh!'
if [[ "$(check_if_file_exists $HOME/.oh-my-zsh/oh-my-zsh.sh)" == "false" ]]
then
bash -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
banner_post 'Oh My Zsh!'
else
banner_skip 'Oh My Zsh!'
fi
# Install Powerlevel10k
banner_pre 'Powerlevel'
ZSH_CUSTOM="${ZSH_CUSTOM:-${HOME}/.oh-my-zsh/custom}"
if [[ "$(check_if_dir_exists ${ZSH_CUSTOM}/themes/powerlevel10k)" == "false" ]]
then
git clone https://github.com/romkatv/powerlevel10k.git $ZSH_CUSTOM/themes/powerlevel10k --single-branch --depth 1
banner_post 'Powerlevel'
else
banner_skip 'Powerlevel'
fi
# Install Antigen
banner_pre 'Antigen Plugin Manager'
if [[ "$(check_if_file_exists ${HOME}/antigen.zsh)" == "false" ]]
then
curl -L git.io/antigen > ${HOME}/antigen.zsh
banner_post 'Antigen Plugin Manager'
else
banner_skip 'Antigen'
fi
# Install Tmux
banner_pre 'Tmux'
set +e
tmux -c echo 1> /dev/null 2> /dev/null
_ec=$?
set -e
[ $_ec -gt 0 ] && brew install tmux && banner_post 'Tmux' || banner_skip 'Tmux'
# Install Vundle
banner_pre 'Vundle'
if [[ "$(check_if_dir_exists $HOME/.vim/bundle/Vundle.vim)" == "false" ]]
then
git clone https://github.com/VundleVim/Vundle.vim.git $HOME/.vim/bundle/Vundle.vim --single-branch --depth=1
banner_post 'Vundle'
else
banner_skip 'Vundle'
fi
# Install Add-ons
## Ctags for Command-T vim plugin
## Stow for link management
#banner_pre 'Add-Ons'
#
#_current_path=$(pwd)
#
#echo 'CTags'
#mkdir /tmp/shell-setup
#pushd /tmp/shell-setup 1> /dev/null
#wget http://prdownloads.sourceforge.net/ctags/ctags-5.8.tar.gz
#tar xzf ctags-5.8.tar.gz
#pushd ctags-5.8 1> /dev/null
#./configure && make
#cp -f ctags $_current_path/overriden-bins/
#popd 1> /dev/null
#popd 1> /dev/null
#
# Create dirs for configuration
mkdir -p /tmp/.vim-backup
mkdir -p /tmp/.vim-undobackup
mkdir -p /tmp/zcomp-dump