-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
executable file
·61 lines (46 loc) · 1.09 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
#! /bin/bash
os=$(uname)
function checkInstall {
package=$1
command=$2
echo -n "check: $command"
if [ -x "$(command -v $command)" ]; then
echo " - installed"
return
fi
echo " - installing..."
if [ "$os" = "Linux" ]; then
sudo apt-get install $package
elif [ "$os" = "Darwin" ]; then
brew install $package
fi
}
if ! [ -e ~/.config ]; then
mkdir ~/.config
else
echo "~/.config - folder found"
fi
link_target=~/.config/nvim
if ! [ -e $link_target ]; then
echo "create softlink from repo to config location"
echo "(it's $link_target)"
ln -s ~/.my_nvim/src $link_target
else
echo "softlink from repo to config found"
echo "(at $link_target)"
fi
echo "check / install dependencies"
if [ "$os" = "Linux" ]; then
checkInstall "riprep" "rg"
checkInstall "fd-find" "fdfind"
elif [ "$os" = "Darwin" ]; then
if ! [ -x "$(command -v brew)" ]; then
echo "brew missing and needed"
return
fi
checkInstall "riprep" "rg"
checkInstall "fd" "fd"
fi
echo "we good"
echo "start nvim and run :PackerSync"
echo "then run :checkhealth for further things to do"