This repository has been archived by the owner on Mar 9, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·66 lines (59 loc) · 1.59 KB
/
install.sh
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
#!/bin/bash
if [ ! -d $HOME/.config ] ; then
echo ".config folder not present, creating..."
mkdir $HOME/.config
fi
echo -e "\nCopying basic config files..."
cp .zshrc $HOME/
cp .vimrc $HOME/
cp -r .config/nvim $HOME/.config/
cp -r .vim $HOME/
echo -e "\nChecking packages..."
if [ "$(uname | grep -i darwin)" != "" ] ; then
echo "macOS detected"
brew help &> /dev/null
if [ $? != 0 ] ; then
echo "Homebrew not installed, aborting..."
exit 1
fi
for pkg in neovim nodejs yarn; do
echo "Checking $pkg..."
brew info $pkg | grep -i "not installed" &> /dev/null
if [ $? == 0 ] ; then
echo "$pkg missing, installing..."
brew install $pkg
if [ $? != 0 ] ; then
echo "Error installing $pkg, aborting..."
exit 1
fi
fi
done
elif [ "$(uname | grep -i linux)" != "" ] ; then
echo "Linux system detected, assuming Debian"
for pkg in neovim nodejs cmdtest; do
echo "Checking $pkg..."
dpkg -s $pkg &> /dev/null
if [ $? != 0 ] ; then
echo "$pkg missing, installing..."
sudo apt-get install $pkg
if [ $? != 0 ] ; then
echo "Error installing $pkg, aborting..."
exit 1
fi
fi
done
else
echo "Unknown system, aborting..."
exit 1
fi
echo -e "\nInstalling vim-plug..."
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
echo -e "\nInstalling vim plugins..."
nvim +PlugInstall +qall
srceryPath=".local/share/nvim/plugged/srcery-vim/colors/srcery.vim"
ls $HOME/$srceryPath &> /dev/null
if [ $? == 0 ] ; then
ln -s -f $HOME/$srceryPath $HOME/.vim/colors/
fi
echo -e "\n...done"
exit 0