6
6
sudo -v
7
7
8
8
# Keep-alive: update existing `sudo` time stamp until this script has finished
9
- while true ; do sudo -n true ; sleep 60; kill -0 " $$ " || exit ; done 2> /dev/null &
9
+ while true ; do
10
+ sudo -n true
11
+ sleep 60
12
+ kill -0 " $$ " || exit
13
+ done 2> /dev/null &
10
14
11
15
if [[ " $OSTYPE " == " darwin" * ]]; then
12
16
13
- # ####################################
14
- # #################### MacOS env setup
15
- # ####################################
17
+ # ####################################
18
+ # #################### MacOS env setup
19
+ # ####################################
16
20
17
- if ! hash brew 2> /dev/null ; then
21
+ if ! hash brew 2> /dev/null; then
18
22
echo " Installing Brew"
19
23
/bin/bash -c " $( curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh) "
20
24
fi
21
- hash brew 2> /dev/null || { echo " install brew first" ; exit 1 ; }
25
+ hash brew 2> /dev/null || {
26
+ echo " install brew first"
27
+ exit 1
28
+ }
22
29
23
30
brew doctor
24
31
brew tap homebrew/cask-versions
@@ -28,14 +35,14 @@ if [[ "$OSTYPE" == "darwin"* ]]; then
28
35
brew install screen the_silver_searcher git curl hub fd fzf wget cmake node
29
36
30
37
# This little joke kills some of our nicest code.
31
- test -r /etc/bashrc_Apple_Terminal && \
38
+ test -r /etc/bashrc_Apple_Terminal &&
32
39
sudo mv /etc/bashrc_Apple_Terminal /etc/bashrc_Apple_Terminal.disabled
33
40
34
- elif [[ -f /etc/redhat-release ]] ; then
41
+ elif [[ -f /etc/redhat-release ]]; then
35
42
36
- # ####################################
37
- # #################### RH-ish env setup
38
- # ####################################
43
+ # ####################################
44
+ # #################### RH-ish env setup
45
+ # ####################################
39
46
40
47
# Enable Fedora
41
48
sudo dnf copr enable tkbcopr/fd -y
@@ -46,22 +53,22 @@ elif [[ -f /etc/redhat-release ]] ; then
46
53
git clone -q --depth 1 https://github.com/junegunn/fzf.git ~ /.fzf &&
47
54
~ /.fzf/install --all --no-zsh --no-fish --no-update-rc
48
55
49
- elif [[ " $( lsb_release -is) " == " Ubuntu" ]] || [[ " $( lsb_release -is) " == " Debian" ]] ; then
56
+ elif [[ " $( lsb_release -is) " == " Ubuntu" ]] || [[ " $( lsb_release -is) " == " Debian" ]]; then
50
57
51
- # ####################################
52
- # ################### Ubuntu env setup
53
- # ####################################
58
+ # ####################################
59
+ # ################### Ubuntu env setup
60
+ # ####################################
54
61
55
62
echo " installing some essential packages"
56
63
sudo apt update
57
64
sudo apt install -y screen silversearcher-ag curl git \
58
- software-properties-common python3-pip rubygems tmux build-essential \
59
- cmake python3-dev nodejs npm python-dev
65
+ software-properties-common python3-pip rubygems tmux build-essential \
66
+ cmake python3-dev nodejs npm python-dev
60
67
61
68
# Adding backports, neovim and other useful bits.
62
69
sudo add-apt-repository -u " deb http://archive.ubuntu.com/ubuntu/ $( lsb_release -cs) -backports main restricted universe multiverse"
63
70
64
- if ! hash nvim 2> /dev/null ; then
71
+ if ! hash nvim 2> /dev/null; then
65
72
echo " install neovim, trying from default sources"
66
73
sudo apt install -y neovim || {
67
74
sudo add-apt-repository -u ppa:neovim-ppa/stable -y && sudo apt update
@@ -78,11 +85,11 @@ elif [[ "$(lsb_release -is)" == "Ubuntu" ]] || [[ "$(lsb_release -is)" == "Debia
78
85
fi
79
86
80
87
# Download fd
81
- if hash fd 2> /dev/null ; then
88
+ if hash fd 2> /dev/null; then
82
89
echo " fd exists."
83
90
else
84
91
fdversion=7.2.0
85
- wget -q https://github.com/sharkdp/fd/releases/download/v${fdversion} /fd_${fdversion} _amd64.deb && \
92
+ wget -q https://github.com/sharkdp/fd/releases/download/v${fdversion} /fd_${fdversion} _amd64.deb &&
86
93
sudo dpkg -i fd_${fdversion} _amd64.deb
87
94
88
95
rm -Rf fd_${fdversion} _amd64.deb
99
106
100
107
[[ -d " $HOME /.homesick/repos/homeshick" ]] ||
101
108
git clone https://github.com/andsens/homeshick.git " $HOME /.homesick/repos/homeshick"
109
+ # shellcheck disable=SC1091
102
110
source " $HOME /.homesick/repos/homeshick/homeshick.sh"
103
111
104
112
# Have ensured that homesick is available
105
113
hash homeshick 2> /dev/null || (echo " homeshick install failed" && exit 1)
106
114
107
115
pip3 install --upgrade powerline-status --user
108
116
109
- if [[ -d " $HOME /.homesick/repos/dotfiles" ]] ; then
117
+ if [[ -d " $HOME /.homesick/repos/dotfiles" ]]; then
110
118
echo " Oh good, the homeshick is already checked out..."
111
119
else
112
120
# # Clone dotfiles
113
121
echo " Cloning the dotfiles"
114
122
homeshick clone seefood/dotfiles
115
123
116
- while read -r dir ; do
124
+ while read -r dir; do
117
125
mkdir -p ~ /" ${dir} "
118
- done < ~ /.homesick/repos/dotfiles/.homesick_subdir
126
+ done < ~/.homesick/repos/dotfiles/.homesick_subdir
119
127
fi
120
128
121
129
homeshick symlink dotfiles
@@ -128,16 +136,16 @@ echo "Make sure you have your correct settings in ~/.gitconfig.local"
128
136
echo ' '
129
137
echo " Now installing vundle..."
130
138
echo ' '
131
- [[ -d ~ /.vim/bundle/Vundle.vim ]] || \
139
+ [[ -d ~ /.vim/bundle/Vundle.vim ]] ||
132
140
git clone -q https://github.com/VundleVim/Vundle.vim.git ~ /.vim/bundle/Vundle.vim
133
141
134
142
# Install pathogen for vim/neovim
135
143
mkdir -p ~ /.vim/autoload ~ /.vim/bundle
136
- [[ -r ~ /.vim/autoload/pathogen.vim ]] || \
144
+ [[ -r ~ /.vim/autoload/pathogen.vim ]] ||
137
145
curl -LSso ~ /.vim/autoload/pathogen.vim https://tpo.pe/pathogen.vim
138
146
139
147
# Vim color scheme install
140
- if ! [[ -d ~ /.vim/colors/wombat/ ]] ; then
148
+ if ! [[ -d ~ /.vim/colors/wombat/ ]]; then
141
149
echo ' '
142
150
echo " Now installing vim wombat color scheme..."
143
151
echo ' '
@@ -149,7 +157,7 @@ echo 'fire up vundle installation'
149
157
vim +PluginInstall +qall && echo ' vim plugins installed!'
150
158
151
159
# Bash color scheme
152
- if ! [[ -r ~ /.dircolors ]] ; then
160
+ if ! [[ -r ~ /.dircolors ]]; then
153
161
echo ' '
154
162
echo " Now installing solarized dark WSL color scheme..."
155
163
echo ' '
0 commit comments