/
install.sh
43 lines (35 loc) · 1.09 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
# #!/bin/sh
DOTFILES_PATH="$HOME/dotfiles"
# Install Rosseta2
if [[ "$(uname -m)" == arm64 ]]; then
softwareupdate --install-rosetta --agree-to-license
fi
# Setup Homebrew
if [ -x "$(command -v brew)" ]; then
brew update
else
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
if [[ "$(uname -m)" == arm64 ]]; then # M1
# echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
echo "⚠️ You might reboot the machine... if brew is not found"
elif [[ "$(uname -m)" == x86_64 ]]; then # Intel
eval "$(/usr/local/bin/brew shellenv)"
fi
fi
sudo echo /opt/homebrew/bin/fish >> /etc/shells
chsh -s /opt/homebrew/bin/fish
fish_add_path /opt/homebrew/bin
# Setup .dotfiles
if [ -d $DOTFILES_PATH ]; then
pushd $DOTFILES_PATH; git pull; popd
else
git clone git@github.com:katsumeshi/dotfiles.git $DOTFILES_PATH
fi
# Brew
brew bundle --file $DOTFILES_PATH/Brewfile
if [ -x "$(command -v volta)" ]; then
volta setup
fi
sh $DOTFILES_PATH/.symlinks
echo 'Set up is done. Restart your terminal'