-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinstall
executable file
·39 lines (29 loc) · 897 Bytes
/
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
#!/bin/sh
set -eux
# 0. Ensure `brew` can be found
if [ "$(uname -m)" = arm64 ] && ! echo "$PATH" | grep -q /opt/homebrew/bin; then
export PATH="/opt/homebrew/bin:$PATH"
fi
# 1. Install Homebrew
if ! command -v brew >/dev/null; then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
# 2. Install Homebrew Bundle
brew tap Homebrew/bundle
# 3. Clone the repo
_dir=$HOME/.dotfiles
if [ ! -d "$_dir" ]; then
git clone https://github.com/atipugin/dotfiles.git "$_dir"
fi
# 4. Install brews and apps
brew bundle --file="$_dir/Brewfile"
# 5. Install dotfiles
xargs stow --dir "$_dir" --target "$HOME" --verbose <"$_dir/Stowfile"
# 6. Configure OSX
"$_dir/osx"
# 7. Configure fish as default shell
_fish_path=$(which fish)
if ! grep -q "$_fish_path" /etc/shells; then
echo "$_fish_path" | sudo tee -a /etc/shells
fi
chsh -s "$_fish_path"