-
Notifications
You must be signed in to change notification settings - Fork 8
/
install.sh
executable file
·52 lines (44 loc) · 1.67 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
#!/usr/bin/env bash
# Use colors, but only if connected to a terminal, and that terminal
# supports them.
if which tput >/dev/null 2>&1; then
ncolors=$(tput colors)
fi
if [ -t 1 ] && [ -n "$ncolors" ] && [ "$ncolors" -ge 8 ]; then
RED="$(tput setaf 1)"
GREEN="$(tput setaf 2)"
YELLOW="$(tput setaf 3)"
BLUE="$(tput setaf 4)"
BOLD="$(tput bold)"
NORMAL="$(tput sgr0)"
else
RED=""
GREEN=""
YELLOW=""
BLUE=""
BOLD=""
NORMAL=""
fi
echo "${BOLD}Note: git and zsh are required."
failed=false
packages=( git zsh )
for package in "${packages[@]}"
do
command -v ${package} >/dev/null 2>&1 || { echo "${RED}${package} is missing."; failed=true; }
done
if ${failed} == true; then
echo "${NORMAL}Please ensure you have all required packages installed. i.e.:"
echo "${YELLOW}${BOLD}Arch: ${NORMAL}sudo pacman -S git zsh"
echo "${YELLOW}${BOLD}Centos: ${NORMAL}sudo yum install git zsh"
echo "${YELLOW}${BOLD}Fedora: ${NORMAL}sudo dnf install git zsh"
echo "${YELLOW}${BOLD}Homebrew: ${NORMAL}sudo brew install git zsh"
echo "${YELLOW}${BOLD}Ubuntu: ${NORMAL}apt-get install git zsh"
echo "After doing so, re-run this script."
exit 1
fi
git clone https://github.com/andsens/homeshick.git $HOME/.homesick/repos/homeshick
${HOME}/.homesick/repos/homeshick/bin/homeshick clone -b https://github.com/keelerm84/dotfiles
# @todo: loop through pre-existing linkable files and directories and move them to `.dotsave` or something.
${HOME}/.homesick/repos/homeshick/bin/homeshick link -b
echo "${GREEN}${BOLD}Installation complete! You can now run \`sudo chsh -s /bin/zsh $(whoami)\` to set zsh as your default shell."
echo "${NORMAL}"