-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
executable file
·55 lines (45 loc) · 1.34 KB
/
install
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
#!/usr/bin/env bash
set -eo pipefail
CASTLE_NAME="homeshick-base"
if [ -f /etc/os-release ]; then
source /etc/os-release
if [ "${ID_LIKE}" == "deian" ]; then
if ! hash sudo 2> /dev/null; then
echo "Please install sudo!"
exit 1
fi
installed=$(sudo dpkg -l bash-completion > /dev/null 2>&1)
if [ $? -eq 1 ]; then
sudo apt-get install bash
fi
installed=$(sudo dpkg -l git-core > /dev/null 2>&1)
if [ $? -eq 1 ]; then
sudo apt-get install git
fi
fi
else
if [ -f /usr/bin/sw_vers ]; then
if ! hash brew 2> /dev/null; then
echo "Please install homebrew!"
exit 1
fi
installed=$(brew list bash > /dev/null 2>&1)
if [ $? -eq 1 ]; then
brew install bash
fi
installed=$(brew list git > /dev/null 2>&1)
if [ $? -eq 1 ]; then
brew install git
fi
fi
fi
if [ ! -d "~/.homesick/repos/homeshick" ]; then
git clone https://github.com/andsens/homeshick.git ~/.homesick/repos/homeshick
fi
source ~/.homesick/repos/homeshick/homeshick.sh
if [ -d "~/.homesick/repos/${CASTLE_NAME}" ]; then
homeshick pull -f "${CASTLE_NAME}"
else
homeshick clone -f "https://github.com/tboerger/${CASTLE_NAME}"
fi
homeshick link -f "${CASTLE_NAME}"