This repository was archived by the owner on Apr 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetUpMyMac.sh
More file actions
executable file
·67 lines (55 loc) · 2.12 KB
/
Copy pathsetUpMyMac.sh
File metadata and controls
executable file
·67 lines (55 loc) · 2.12 KB
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
#!/bin/bash
set -euo pipefail
targetUser=${1:-$(whoami)}
if [ $(which brew) ]; then
echo "Skipping installation of Homebrew (already installed)"
else
echo "Installing Homebrew ..."
./homebrew-install.sh
echo "Done installing Homebrew"
fi
./homebrew-setup.sh "${targetUser}"
if [ "${targetUser}" != "$(whoami)" ]; then
echo "Switch to '${targetUser}' and run setup again."
exit 0
fi
brew bundle
if [ ! -e ~/.oh-my-zsh ]; then
echo "Installing Oh-My-Zsh ..."
./oh-my-zsh-install.sh || exit
echo "Done installing Oh-My-Zsh"
else
echo "Skipping installation of Oh-My-Zsh (already installed)"
fi
if [ ! -e ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k ]; then
echo "Installing PowerLevel10K theme ..."
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
echo "Done installing PowerLevel10K theme"
else
echo "Skipping installation of PowerLevel10K theme (already installed)"
fi
if [ -e ~/Library/Fonts/"Droid Sans Mono for Powerline Nerd Font Complete.otf" ]; then
echo "Skipping installation of Powerline font (already installed)"
else
echo "Installing Powerline font ..."
curl -fLo ~/Library/Fonts/"Droid Sans Mono for Powerline Nerd Font Complete.otf" https://raw.githubusercontent.com/ryanoasis/nerd-fonts/master/patched-fonts/DroidSansMono/complete/Droid%20Sans%20Mono%20Nerd%20Font%20Complete%20Mono.otf
echo "Done installing Powerline font"
fi
echo "Ensuring .my.zsh is loaded in .zshrc ..."
cp .my.zsh ~/
cp .p10k.zsh ~/
(grep "\.my\.zsh" ~/.zshrc > /dev/null) || (echo "\n[[ ! -f ~/.my.zsh ]] || source ~/.my.zsh" >> ~/.zshrc)
echo "Done"
if [ -e ~/Library/Preferences/com.googlecode.iterm2.plist ]; then
echo "Skipping installation of iTerm preferences since they already exist"
echo "> To overwrite existing iTerm preferences, run ./iterm-prefs-install.sh"
else
echo "Installing iTerm preferences ..."
./iterm-prefs-install.sh
echo "Done installing iTerm preferences"
fi
echo "Configuring git..."
./git-config.sh
cp .gitignore_global ~/.gitignore_global
echo "Done configuring git"
echo "===== Mac setup complete ====="