-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathrun
59 lines (51 loc) · 1.15 KB
/
run
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
#!/bin/bash
NVIM=$(which nvim)
_install_appimage() {
pushd $HOME
[ ! -d ./Applications ] && mkdir Applications
cd Applications
wget https://github.com/neovim/neovim/releases/download/v0.7.0/nvim.appimage -O nvim
[ -z "${NVIM}" ] && NVIM="~/Applications/nvim"
chmod +x $NVIM
popd
}
install() {
if [ $2 = "deps" ]
then
if [ -x "$(command -v pacman)" ]
then
sudo pacman -Sy stow neovim fd ripgrep fzf git-delta
elif [ -x "$(command -v apt-get)" ]
then
_install_appimage
sudo apt-get install stow fd-find ripgrep fzf
fi
python -m pip install pynvim
git submodule update
fi
pushd ~/
[ -f .bashrc ] && mv .bashrc .bashrc.old
cd .dotfiles
for folder in $(ls -d */ | sed "s/,/ /g")
do
stow $folder
done
popd
}
remove() {
pushd ~/.dotfiles
for folder in $(ls -d */ | sed "s/,/ /g")
do
stow -D $folder
done
popd
}
reinstall() {
remove
install
}
case $1 in
"install") install $@ ;;
"remove") remove $@ ;;
"reinstall") reinstall $@ ;;
esac