-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·37 lines (30 loc) · 1.21 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
#!/usr/bin/env bash
WD="$(pwd)"
DIR="$( cd "$(dirname "$0")" > /dev/null && pwd )"
BREW_DIR="/opt/homebrew"
# Install homebrew if we need to.
if [ -f "$BREW_DIR/bin/homebrew" ]; then
echo "Homebrew already installed"
else
echo "Installing homebrew..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# Install homebrew packages.
printf "Installing homebrew packages..."
"$BREW_DIR/bin/homebrew" tap homebrew/bundle > /dev/null
"$BREW_DIR/bin/homebrew" bundle --file="$DIR/Brewfile" --no-lock > /dev/null
echo "done."
# Symlink everything.
printf 'Linking items from %s to home directory...' "$DIR"
find "$DIR" -type d \( ! -regex '.*/\..*' \) -depth 1 | sed 's!.*/!!' | xargs stow --dir="$DIR" --target="$HOME" --restow
echo "done."
# fzf
"$BREW_DIR"/opt/fzf/install --no-bash --no-zsh --all
# Install vim plugins
if [ ! -d ~/.local/share/vim/pack/packager/opt/vim-packager ]; then
git clone https://github.com/kristijanhusak/vim-packager ~/.local/share/vim/pack/packager/opt/vim-packager
fi
mvim -f -c "call PackagerInit() | call packager#install({'on_finish': ':w! >>/dev/tty | quitall'})"
# Finally, go back to where we started.
cd "$WD" > /dev/null || exit 1
exit 0