-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·63 lines (40 loc) · 1.39 KB
/
bootstrap.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
#! /usr/bin/env bash
# Set directory definitions
DOTFILES_DIR=$HOME/.dotfiles
DOTFILES_GIT_REMOTE="https://github.com/bradenmitchell/dotfiles.git"
# Locate and enter dotfiles directory
if [[ ! -d $DOTFILES_DIR ]]; then
git clone $DOTFILES_GIT_REMOTE $DOTFILES_DIR
fi
cd $DOTFILES_DIR
# Load helper functions
for file in $(ls ./utils); do
source ./utils/$file
done
# Installs (updates if already installed) homebrew
install_homebrew
# Installs packages, applications & fonts with brew/mas
brew_bundle $DOTFILES_DIR/brew/Brewfile
# Checks if homebrew shell versions are listed as allowed shells, adds if necessary
add_new_shell $(which zsh)
add_new_shell $(which bash)
# Sets homebrew zsh as default shell
set_default_shell $(which zsh)
# Create symlinks, files, directories, etc.
symlink $DOTFILES_DIR/zsh/.zshrc $HOME/.config/zsh/.zshrc
symlink $DOTFILES_DIR/git $HOME/.config/git
mkdir -p $HOME/Projects
touch $HOME/.hushlogin
# Change some home dir file attributes
[[ -d $HOME/Public ]] && chflags hidden $HOME/Public
[[ -d $HOME/Applications ]] && chflags hidden $HOME/Applications
# Add .zshenv to set $ZDOTDIR
if [[ ! -f $HOME/.zshenv ]]; then
echo -e "# Set zsh config directory\nexport ZDOTDIR=\"$HOME/.config/zsh\"" >> $HOME/.zshenv
fi
# Install node.js
install_node
# Install python
install_python
# Run macOS defaults script
source $DOTFILES_DIR/macos/defaults