-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·119 lines (100 loc) · 2.66 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
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
#!/bin/bash
function exists() {
which "$1" >/dev/null 2>&1
return $?
}
function is_ubuntu() {
[ ! -d /etc/lsb-release ]
return $?
}
if exists "sudo"; then
SUDO="sudo"
else
SUDO=""
fi
if exists "apt"; then
${SUDO} apt update
fi
if is_ubuntu; then
${SUDO} apt install -y software-properties-common
${SUDO} apt update
fi
if ! exists "git" && exists "apt"; then
${SUDO} apt install -y git
fi
if ! exists "curl" && exists "apt"; then
${SUDO} apt install -y curl
fi
if [ ! -d ~/dotfiles ]; then
git clone https://github.com/oza6ut0ne/dotfiles.git ~/dotfiles
fi
cd ~/dotfiles
./deploy.sh
if [ ! -d ~/.asdf ]; then
git clone https://github.com/asdf-vm/asdf.git ~/.asdf
. ~/.asdf/asdf.sh
asdf update
mkdir -p ~/.config/fish/completions
ln -s ~/.asdf/completions/asdf.fish ~/.config/fish/completions
fi
if ! exists "nvim"; then
if is_ubuntu; then
${SUDO} apt-add-repository ppa:neovim-ppa/unstable -y
${SUDO} apt update
fi
if exists "apt"; then
${SUDO} apt install -y neovim
fi
fi
if ! exists "direnv"; then
asdf plugin-add direnv
asdf install direnv latest
asdf global direnv latest
fi
if ! exists "fzf"; then
asdf plugin-add fzf
asdf install fzf latest
asdf global fzf latest
fi
if ! exists "zoxide"; then
asdf plugin-add zoxide
asdf install zoxide latest
asdf global zoxide latest
fi
if ! exists "hub" && exists "apt"; then
${SUDO} apt install -y hub
fi
if is_ubuntu; then
${SUDO} apt install -y python3 python3-pip
/usr/bin/python3 -m pip install --user pynvim
fi
if ! asdf list | grep -q python; then
if exists "apt"; then
${SUDO} apt install -y make build-essential llvm curl wget
${SUDO} apt install -y libssl-dev zlib1g-dev libbz2-dev
${SUDO} apt install -y libreadline-dev libsqlite3-dev
${SUDO} apt install -y libncursesw5-dev xz-utils tk-dev libffi-dev
${SUDO} apt install -y libxml2-dev libxmlsec1-dev liblzma-dev
fi
asdf plugin-add python
asdf install python latest
asdf global python latest
fi
if ! exists "zsh"; then
if exists "apt"; then
${SUDO} apt install -y zsh
fi
chsh -s "$(which zsh)"
fi
if ! exists "fish"; then
if is_ubuntu; then
${SUDO} apt-add-repository ppa:fish-shell/release-3 -y
${SUDO} apt update
fi
if exists "apt"; then
${SUDO} apt install -y fish
fi
curl -L http://get.oh-my.fish | fish
curl -Lo ~/.config/fish/functions/fisher.fish --create-dirs https://git.io/fisher
fish -c 'fisher install jethrokuan/fzf jorgebucaran/fish-spin edc/bass oh-my-fish/plugin-balias oh-my-fish/plugin-extract'
fi