-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup-macos.sh
executable file
·95 lines (76 loc) · 2.8 KB
/
setup-macos.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/sh
echo "Setting up $USER's Mac..."
# Ask for the administrator password upfront
sudo -v
# Update macOS
echo "Updating macOS"
softwareupdate -lia
# Install Xcode Command Line Tools
xcode-select --install
sudo xcodebuild -license accept
# Check for Homebrew and install if not installed
echo "Checking for Homebrew and installing if not found"
if test ! $(which brew); then
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/anvil/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
fi
# Update Homebrew recipes
echo "Updating and upgrading Brew"
brew update
brew upgrade
# Install all Homebrew packages
echo "Installing Homebrew packages"
source "$PWD/packages/homebrew-install.sh"
brew cleanup
#Make ZSH from homebrew the default shell environment
echo "Setting ZSH from homebrew as the default shell"
sudo dscl . -create /Users/$USER UserShell /opt/homebrew/bin/zsh
which zsh
zsh --version
#Install Pure theme
mkdir -p "$HOME/.zsh"
git clone https://github.com/sindresorhus/pure.git "$HOME/.zsh/pure"
# Install Node and Yarn through NVM
echo "Installing Node through nvm and node"
mkdir ~/.nvm
nvm install node
# Install packages
echo "Installing npm packages"
source "$PWD/packages/npm.sh"
# Install oh-my-zsh
echo "Installing oh-my-zsh"
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# Symbolic link dotfiles to ~/
echo "Symbolic linking dotfiles..."
echo "Symbolic linking git"
ln -sf "$PWD/git/.gitconfig" ~
ln -sf "$PWD/git/.gitignore_global" ~
#Symbolic link terminal settings
echo "Symbolic linking terminal settings"
ln -sf "$PWD/hyper/.hyper.js" ~
ln -sf "$PWD/shell/.alacritty.yml" ~
echo "Symbolic linking zsh files"
ln -sf "$PWD/shell/zsh/.zshrc" ~
ln -sf "$PWD/shell/zsh/aliases.zsh" ~/.oh-my-zsh/custom/
ln -sf "$PWD/shell/zsh/exports.zsh" ~/.oh-my-zsh/custom/
ln -sf "$PWD/shell/zsh/functions.zsh" ~/.oh-my-zsh/custom/
ln -sf "$PWD/shell/zsh/path.zsh" ~/.oh-my-zsh/custom/
echo "Copying private files"
ln -sf /Volumes/GoogleDrive/My\ Drive/Dev\ Tools/private.zsh ~/.oh-my-zsh/custom/
ln -sf /Volumes/GoogleDrive/My\ Drive/Dev\ Tools/.ssh ~/
ln -sf /Volumes/GoogleDrive/My\ Drive/Dev\ Tools/.aws ~/
# Set macOS defaults
# echo "Setting up macOS defaults"
# source "$PWD/os/macos.sh"
# echo "Applying app preferences"
# source "$PWD/os/app-preferences.sh"
#Add SSH key to ssh agent
eval "$(ssh-agent -s)"
ssh-add -K ~/.ssh/id_ed25519
echo "."
echo ".."
echo "..."
echo "Your Mac has been setup $USER :)"