-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·72 lines (44 loc) · 1.71 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
#!/bin/sh
set -o errexit
set -o nounset
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
export XDG_CONFIG_HOME=${HOME}/.config
mkdir -p ${XDG_CONFIG_HOME}
# Submodule'd dependencies
echo "Cloning submodules..."
git -C ${SCRIPT_DIR} submodule update --init
echo "...done cloning submodules"
# ZSH
echo "Configuring ZSH..."
[[ -e "${HOME}/.zshrc" ]] && rm -f "${HOME}/.zshrc.bak" && mv -f "${HOME}/.zshrc" "${HOME}/.zshrc.bak"
ln -fhs "${SCRIPT_DIR}/.zshrc" "${HOME}/.zshrc"
echo "...done configuring ZSH"
# Oh My ZSH
echo "Installing Oh My ZSH!..."
OMZ_DIR="${XDG_CONFIG_HOME}/oh-my-zsh"
[[ -e "${OMZ_DIR}" ]] && rm -f "${OMZ_DIR}.bak" && mv -f "${OMZ_DIR}" "${OMZ_DIR}.bak"
ln -fhs "${SCRIPT_DIR}/oh-my-zsh/" "${OMZ_DIR}"
echo "...done installing Oh My ZSH!"
# Git
echo "Configuring git..."
GIT_CONF_DIR=${XDG_CONFIG_HOME}/git
[[ -e "${GIT_CONF_DIR}" ]] && rm -f "${GIT_CONF_DIR}.bak" $$ mv -f "${GIT_CONF_DIR}" "${GIT_CONF_DIR}.bak"
ln -fhs "${SCRIPT_DIR}/git" "${GIT_CONF_DIR}"
echo "...done configuring git"
# Homebrew
echo "Installing Homebrew..."
BREW_BINARY=/opt/homebrew/bin/brew
[[ -f "${BREW_BINARY}" ]] || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "...done installing Homebrew"
echo "Installing Homebrew packages..."
"${BREW_BINARY}" bundle --file "${SCRIPT_DIR}/Brewfile"
echo "...done installing Homebrew packages"
# Vim
echo "Configuring NeoVIM..."
VIM_CONF_DIR="${XDG_CONFIG_HOME}/vim"
[[ -e "${VIM_CONF_DIR}" ]] && rm -f "${VIM_CONF_DIR}.bak" && mv -f "${VIM_CONF_DIR}" "${VIM_CONF_DIR}.bak"
ln -fhs "${SCRIPT_DIR}/vim-config/" "${VIM_CONF_DIR}"
nvim +PluginInstall +qa
echo "...done configuring NeoVIM"
echo
echo "Done!"