-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sh
executable file
·57 lines (42 loc) · 1.35 KB
/
init.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
#!/bin/bash
THIS_DIR=$(cd "$(dirname $0)" || exit; pwd)
# rosetta
sudo softwareupdate --install-rosetta --agree-to-license
# dotfiles
for dotfile in "${THIS_DIR}"/dotfiles/*; do
ln -snfv "${THIS_DIR}/dotfiles/$dotfile" "$HOME/$dotfile"
done
# .gitignore
mkdir -p $HOME/.config/git
ln -snfv "${THIS_DIR}/.gitignore_global" "$HOME/.config/git/ignore"
# .vimrc
mkdir -p $HOME/.config/nvim
ln -snfv "${THIS_DIR}/dotfiles/.vimrc" "$HOME/.config/nvim/init.vim"
ln -snfv "${THIS_DIR}/dotfiles/.vimrc" "$HOME/.ideavimrc"
# .mise.toml
mkdir -p $HOME/.config/mise
ln -snfv "${THIS_DIR}/.mise.toml" "$HOME/.config/mise/config.toml"
# poetry.toml
mkdir -p $HOME/Library/Application\ Support/pypoetry
ln -snfv "${THIS_DIR}/poetry.toml" ${HOME}/Library/Application\ Support/pypoetry/config.toml
# Homebrew
if ! (type "brew" >/dev/null 2>&1); then
echo "installing Homebrew ..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
echo "run brew doctor ..."
brew doctor
echo "run brew update ..."
brew update
echo "run brew upgrade ..."
brew upgrade
echo "run brew bundle ..."
brew bundle --file=${THIS_DIR}/Brewfile
echo "run brew cleanup ..."
brew cleanup
# mise
cd ${THIS_DIR}/dotfiles && mise install && cd ${THIS_DIR} || exit
source "$HOME/.zshrc"
# poetry
pipx install poetry