-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·41 lines (32 loc) · 1.45 KB
/
Copy pathsetup.sh
File metadata and controls
executable file
·41 lines (32 loc) · 1.45 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
#!/usr/bin/env bash
#
# Bootstrap a new machine from this dotfiles repo.
# Safe to re-run; every step is idempotent.
set -euo pipefail
DOTFILES_DIR="$HOME/dotfiles"
PRIVATE_DOTFILES_DIR="$HOME/private-dotfiles"
info() { printf '\033[1;34m==>\033[0m %s\n' "$*"; }
# --- Homebrew -----------------------------------------------------------
if ! command -v brew >/dev/null 2>&1; then
info "Installing Homebrew"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
fi
eval "$(/opt/homebrew/bin/brew shellenv)"
info "Installing packages from Brewfile"
# Homebrew 6 skips third-party tap formulae unless the tap is trusted.
grep -E '^tap "' "$DOTFILES_DIR/Brewfile" | sed -E 's/tap "([^"]+)".*/\1/' | while read -r tap; do
brew trust "$tap" >/dev/null
done
brew bundle install --file="$DOTFILES_DIR/Brewfile" --no-upgrade
# --- Git submodules (prezto, tpm, vundle, zsh-z) ------------------------
info "Initializing git submodules"
git -C "$DOTFILES_DIR" submodule update --init --recursive
# --- Private dotfiles ----------------------------------------------------
if [ ! -d "$PRIVATE_DOTFILES_DIR" ]; then
info "NOTE: $PRIVATE_DOTFILES_DIR not found."
info "Clone it before running rcup so private configs get linked too."
fi
# --- Symlinks via rcm ----------------------------------------------------
info "Linking dotfiles with rcup"
RCRC="$DOTFILES_DIR/tag-osx/rcrc" rcup -v
info "Done. Open a new shell or run: exec zsh"