-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·53 lines (45 loc) · 1.35 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
#!/bin/bash
# [ $(whoami) != 'root' ] || echo 'Please run with elevated permissions; exiting.'; exit;
install_stow() {
echo "Checking packages..."
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
if [ $(dpkg-query -W -f='${Status}' apt 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
echo "Error - please install apt and run this script again."
exit
fi
sudo apt install build-essential gcc
sudo apt-get install -y stow
elif [[ "$OSTYPE" == "darwin"* ]]; then
which -s brew
if [[ $? != 0 ]] ; then
echo "Error - please install brew and run this script again."
exit
fi
sudo brew install stow
else
echo "Error - this script only works on linux or macos."
exit
fi
}
# Configure dotfiles
stow_files() {
bash $1/configure.sh
}
install_packages() {
echo "Installing packages..."
# Order is important here! Setup fish before dev.
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
bash $d/setup/linuxInstall.sh
elif [[ "$OSTYPE" == "darwin"* ]]; then
bash $d/setup/macInstall.sh
else
echo "sorry! this script only works on linux or macos."
fi
}
echo "Setting up environment... 🚀"
# Set current directory
d=$(dirname $(readlink -f $0))
install_stow
install_packages
stow_files $d
echo "Done. 👍"