-
Notifications
You must be signed in to change notification settings - Fork 1
/
install.sh
executable file
·62 lines (53 loc) · 1.03 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
#/bin/bash
required=(git vim zsh htop)
function downloadList() {
varname=$1[@]
list=${!varname}
for f in $list
do
downloadPackage $f
done
}
function printList() {
varname=$1[@]
list=${!varname}
for f in $list
do
echo " - $f"
done
}
function downloadPackage() {
package=$1
echo "Installing $package..."
sudo apt-get install $package -y > /dev/null
}
function downloadDotfiles() {
mkdir git
cd git
git clone https://github.com/AlanSherman/dotfiles.git
cd ./dotfiles
. ./setup.sh
echo "Dotfile installation complete"
}
function wizard() {
title=$1
name=$2
afterRequires=$3
after=$4
echo "$1 Packages: "
printList $2
printList $afterRequires
read -p "Install the packages above for Alan Sherman's dotfiles? (Y/N) " -n 1
echo
if [[ $REPLY =~ ^[Yy]$ ]]
then
downloadList $2
$after
fi
}
function runPrompts() {
wizard "Required" required
downloadDotfiles
echo "Done!"
}
runPrompts