-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall.sh
executable file
·110 lines (97 loc) · 2.68 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
#!/bin/bash
if [ "$OSTYPE" = "linux-android" ]; then
echo "Installing packages for Termux"
pkg install \
clang \
debianutils \
git \
make \
openssh \
silversearcher-ag \
tree \
vim
if [ -d "$HOME/storage" ]; then
echo "Storage is already set up"
else
termux-setup-storage
fi
if [ -f "$HOME/.hushlogin" ]; then
echo "Login message already suppressed"
else
echo "Suppressing login message"
touch "$HOME/.hushlogin"
fi
fi
OS="$(lsb_release -i | awk -F '\t' '{print $2}')"
if [[ "$CODESPACES" == "true" ]]; then
echo "Installing packages for GitHub Codespaces"
apt install \
silversearcher-ag \
tree
else
if [[ "$OS" == "Ubuntu" ]]; then
echo "Installing packages for Ubuntu"
sudo apt install \
autoconf \
bison \
build-essential \
dict-gcide \
libdb-dev \
libffi-dev \
libgdbm-dev \
libgdbm6 \
libncurses5-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libyaml-dev \
postgresql \
postgresql-server-dev-12 \
silversearcher-ag \
sqlite3 \
tree \
ubuntu-wsl \
zlib1g-dev
fi
fi
echo "Symlinking dotfiles into $HOME"
dotfiles_directory="$(pwd)/shell"
ls -1 "$dotfiles_directory" | xargs -i ln -nsf "$dotfiles_directory/{}" "$HOME/.{}"
echo "Symlinking scripts & utilities into $HOME/bin"
mkdir -p "$HOME/bin"
bin_directory="$(pwd)/bin"
ls -1 "$bin_directory" | xargs -i ln -nsf "$bin_directory/{}" "$HOME/bin/{}"
if [ -d "$HOME/.rbenv" ]; then
echo "rbenv is already installed"
else
echo "Installing rbenv"
git clone https://github.com/rbenv/rbenv.git "$HOME/.rbenv"
cd "$HOME/.rbenv" && src/configure && make -C src
fi
if [ -d "$HOME/.rbenv/plugins/ruby-build" ]; then
echo "ruby-build is already installed"
else
echo "Installing ruby-build"
mkdir -p "$HOME/.rbenv/plugins/ruby-build"
git clone https://github.com/rbenv/ruby-build.git "$HOME/.rbenv/plugins/ruby-build"
fi
if [ -d "$HOME/.vim/pack" ]; then
echo "Vim packages are already set up"
else
echo "Setting up vim packages"
mkdir -p "$HOME/.vim/pack/danhorst/start" "$HOME/.vim/pack/danhorst/opt"
fi
if [ -d "$HOME/.vim/pack/danhorst/start/fugitive" ]; then
echo "Fugative already set up";
else
echo "Installing Fugative"
git clone https://github.com/tpope/vim-fugitive.git "$HOME/.vim/pack/danhorst/start/fugitive"
vim -u NONE -c "helptags fugitive/doc" -c q
fi
if [ -d "$HOME/.vim/pack/danhorst/start/surround" ]; then
echo "Surround already set up";
else
echo "Installing surround";
git clone https://github.com/tpope/vim-surround.git "$HOME/.vim/pack/danhorst/start/surround"
vim -u NONE -c "helptags surround/doc" -c q
fi