-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.sh
executable file
·528 lines (494 loc) · 16.7 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
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
#!/usr/bin/env bash
### ------------ bootstrap.sh - set up development environment ------------ ###
# Adapted from br3ndonland/dotfiles
# https://github.com/MikeMcQuaid/strap, https://github.com/Homebrew/install
set -e
OS=$(uname -s)
case $OS in
Darwin)
export LINUX=0 MACOS=1 UNIX=1
if [[ $(uname -m) == "arm64" ]]; then
DEFAULT_HOMEBREW_PREFIX="/opt/homebrew"
else
DEFAULT_HOMEBREW_PREFIX="/usr/local"
fi
;;
Linux)
export LINUX=1 MACOS=0 UNIX=1
if [[ -d $HOME/.linuxbrew ]]; then
DEFAULT_HOMEBREW_PREFIX="$HOME/.linuxbrew"
else
DEFAULT_HOMEBREW_PREFIX="/home/linuxbrew/.linuxbrew"
fi
[[ $(id -un) == "codespace" ]] && export CODESPACE=1
;;
*) echo "Unsupported operating system $OS" && exit 1 ;;
esac
[[ -z $HOMEBREW_PREFIX ]] && HOMEBREW_PREFIX="$DEFAULT_HOMEBREW_PREFIX"
STRAP_CI=${STRAP_CI:=0}
STRAP_DEBUG=${STRAP_DEBUG:-0}
[[ $1 = "--debug" || -o xtrace ]] && STRAP_DEBUG=1
STRAP_INTERACTIVE=${STRAP_INTERACTIVE:-0}
STDIN_FILE_DESCRIPTOR=0
[ -t "$STDIN_FILE_DESCRIPTOR" ] && STRAP_INTERACTIVE=1
STRAP_GIT_NAME=${STRAP_GIT_NAME:?Variable not set}
STRAP_GIT_EMAIL=${STRAP_GIT_EMAIL:?Variable not set}
STRAP_GITHUB_USER=${STRAP_GITHUB_USER:="mettavi"}
DEFAULT_DOTFILES_URL="https://github.com/$STRAP_GITHUB_USER/dotfiles"
STRAP_DOTFILES_URL=${STRAP_DOTFILES_URL:="$DEFAULT_DOTFILES_URL"}
STRAP_DOTFILES_BRANCH=${STRAP_DOTFILES_BRANCH:="main"}
STRAP_SUCCESS=""
sudo_askpass() {
if [ -n "$SUDO_ASKPASS" ]; then
sudo --askpass "$@"
else
sudo "$@"
fi
}
cleanup() {
set +e
sudo_askpass rm -rf "$CLT_PLACEHOLDER" "$SUDO_ASKPASS" "$SUDO_ASKPASS_DIR"
sudo --reset-timestamp
if [ -z "$STRAP_SUCCESS" ]; then
if [ -n "$STRAP_STEP" ]; then
echo "!!! $STRAP_STEP FAILED" >&2
else
echo "!!! FAILED" >&2
fi
if [ "$STRAP_DEBUG" -eq 0 ]; then
echo "!!! Run '$0 --debug' for debugging output." >&2
fi
fi
}
trap "cleanup" EXIT
if [ "$STRAP_DEBUG" -gt 0 ]; then
set -x
else
STRAP_QUIET_FLAG="-q"
Q="$STRAP_QUIET_FLAG"
fi
# Prompt for sudo password and initialize (or reinitialize) sudo
sudo --reset-timestamp
clear_debug() {
set +x
}
reset_debug() {
if [ "$STRAP_DEBUG" -gt 0 ]; then
set -x
fi
}
logskip() {
STRAP_STEP=""
echo "SKIPPED"
echo "$*"
}
sudo_init() {
if [ "$STRAP_INTERACTIVE" -eq 0 ]; then return; fi
# Check and, if necessary, enable sudo authentication using TouchID.
# Don't care about non-alphanumeric filenames when doing a specific match
# shellcheck disable=SC2010,SC2086
if ls /usr/lib/pam | grep $Q "pam_tid.so"; then
STRAP_STEP="Configuring sudo authentication using TouchID:"
echo "--> $STRAP_STEP"
if [[ -f /etc/pam.d/sudo_local || -f /etc/pam.d/sudo_local.template ]]; then
# New in macOS Sonoma, survives updates.
PAM_FILE="/etc/pam.d/sudo_local"
FIRST_LINE="# sudo_local: local config file which survives system update and is included for sudo"
if [[ ! -f "/etc/pam.d/sudo_local" ]]; then
echo "$FIRST_LINE" | sudo_askpass tee "$PAM_FILE" >/dev/null
fi
else
PAM_FILE="/etc/pam.d/sudo"
FIRST_LINE="# sudo: auth account password session"
fi
if grep $Q pam_tid.so "$PAM_FILE"; then
logk
elif ! head -n1 "$PAM_FILE" | grep $Q "$FIRST_LINE"; then
logskip "$PAM_FILE is not in the expected format!"
else
TOUCHID_LINE="auth sufficient pam_tid.so"
sudo_askpass sed -i .bak -e \
"s/$FIRST_LINE/$FIRST_LINE\n$TOUCHID_LINE/" \
"$PAM_FILE"
sudo_askpass rm "$PAM_FILE.bak"
logk
fi
fi
local SUDO_PASSWORD SUDO_PASSWORD_SCRIPT
if ! sudo --validate --non-interactive &>/dev/null; then
while true; do
read -rsp "--> Enter your password (for sudo access):" SUDO_PASSWORD
echo
if sudo --validate --stdin 2>/dev/null <<<"$SUDO_PASSWORD"; then
break
fi
unset SUDO_PASSWORD
echo "!!! Wrong password!" >&2
done
clear_debug
SUDO_PASSWORD_SCRIPT="$(
cat <<-BASH
#!/usr/bin/env bash
echo "$SUDO_PASSWORD"
BASH
)"
unset SUDO_PASSWORD
SUDO_ASKPASS_DIR="$(mktemp -d)"
SUDO_ASKPASS="$(mktemp "$SUDO_ASKPASS_DIR"/strap-askpass-XXXXXXXX)"
chmod 700 "$SUDO_ASKPASS_DIR" "$SUDO_ASKPASS"
bash -c "cat > '$SUDO_ASKPASS'" <<<"$SUDO_PASSWORD_SCRIPT"
unset SUDO_PASSWORD_SCRIPT
reset_debug
export SUDO_ASKPASS
fi
}
sudo_refresh() {
clear_debug
if [ -n "$SUDO_ASKPASS" ]; then
sudo --askpass --validate
else
sudo_init
fi
reset_debug
}
abort() {
STRAP_STEP=""
echo "!!! $*" >&2
exit 1
}
log() {
STRAP_STEP="$*"
sudo_refresh
echo "--> $*"
}
logn() {
STRAP_STEP="$*"
sudo_refresh
printf -- "--> %s " "$*"
}
logk() {
STRAP_STEP=""
echo "OK"
}
escape() {
printf '%s' "${1//\'/\'}"
}
# Given a list of scripts in the dotfiles repo, run the first one that exists
run_dotfile_scripts() {
if [ -d ~/.dotfiles ]; then
(
cd ~/.dotfiles
for i in "$@"; do
if [ -f "$i" ] && [ -x "$i" ]; then
log "Running dotfiles $i:"
if [ "$STRAP_DEBUG" -eq 0 ]; then
"$i" 2>/dev/null
else
"$i"
fi
break
fi
done
)
fi
}
[ "$USER" = "root" ] && abort "Run bootstrap.sh as yourself, not root."
# shellcheck disable=SC2086
if [ "$MACOS" -gt 0 ]; then
[ "$STRAP_CI" -eq 0 ] && caffeinate -s -w $$ &
groups | grep $Q -E "\b(admin)\b" || abort "Add $USER to admin."
logn "Configuring security settings:"
SAFARI="com.apple.Safari"
sudo_askpass defaults write $SAFARI \
$SAFARI.ContentPageGroupIdentifier.WebKit2JavaEnabled -bool false
sudo_askpass defaults write $SAFARI \
$SAFARI.ContentPageGroupIdentifier.WebKit2JavaEnabledForLocalFiles \
-bool false
sudo_askpass defaults write com.apple.screensaver askForPassword -int 1
sudo_askpass defaults write com.apple.screensaver askForPasswordDelay -int 0
sudo_askpass defaults write \
/Library/Preferences/com.apple.alf globalstate -int 1
sudo_askpass launchctl load \
/System/Library/LaunchDaemons/com.apple.alf.agent.plist 2>/dev/null
if [ -n "$STRAP_GIT_NAME" ] && [ -n "$STRAP_GIT_EMAIL" ]; then
FOUND="Found this computer? Please contact"
LOGIN_TEXT=$(escape "$FOUND $STRAP_GIT_NAME at $STRAP_GIT_EMAIL.")
echo "$LOGIN_TEXT" | grep -q '[()]' && LOGIN_TEXT="'$LOGIN_TEXT'"
sudo_askpass defaults write \
/Library/Preferences/com.apple.loginwindow LoginwindowText "$LOGIN_TEXT"
logk
fi
fi
# Check for and enable full-disk encryption
logn "Checking full-disk encryption status:"
VAULT_MSG="FileVault is (On|Off, but will be enabled after the next restart)."
# shellcheck disable=SC2086
if fdesetup status | grep $Q -E "$VAULT_MSG"; then
logk
elif [ "$MACOS" -eq 0 ] || [ "$STRAP_CI" -gt 0 ]; then
echo
logn "Skipping full-disk encryption."
elif [ "$STRAP_INTERACTIVE" -gt 0 ]; then
echo
log "Enabling full-disk encryption on next reboot:"
sudo_askpass fdesetup enable -user "$USER" |
tee ~/Desktop/"FileVault Recovery Key.txt"
logk
else
echo
abort "Run 'sudo fdesetup enable -user \"$USER\"' for full-disk encryption."
fi
# Set up Xcode Command Line Tools
install_xcode_clt() {
if ! [ -f "/Library/Developer/CommandLineTools/usr/bin/git" ]; then
log "Installing the Xcode Command Line Tools:"
CLT_STRING=".com.apple.dt.CommandLineTools.installondemand.in-progress"
CLT_PLACEHOLDER="/tmp/$CLT_STRING"
sudo_askpass touch "$CLT_PLACEHOLDER"
CLT_PACKAGE=$(softwareupdate -l |
grep -B 1 "Command Line Tools" |
awk -F"*" '/^ *\*/ {print $2}' |
sed -e 's/^ *Label: //' -e 's/^ *//' |
sort -V |
tail -n1)
sudo_askpass softwareupdate -i "$CLT_PACKAGE"
sudo_askpass rm -f "$CLT_PLACEHOLDER"
if ! [ -f "/Library/Developer/CommandLineTools/usr/bin/git" ]; then
if [ "$STRAP_INTERACTIVE" -gt 0 ]; then
echo
logn "Requesting user install of Xcode Command Line Tools:"
xcode-select --install
else
echo
abort "Install Xcode Command Line Tools with 'xcode-select --install'."
fi
fi
logk
fi
}
# shellcheck disable=SC2086
check_xcode_license() {
if /usr/bin/xcrun clang 2>&1 | grep $Q license; then
if [ "$STRAP_INTERACTIVE" -gt 0 ]; then
logn "Asking for Xcode license confirmation:"
sudo_askpass xcodebuild -license
logk
else
abort "Run 'sudo xcodebuild -license' to agree to the Xcode license."
fi
fi
}
if [ "$MACOS" -gt 0 ]; then
install_xcode_clt
check_xcode_license
else
log "Not macOS. Xcode CLT install and license check skipped."
fi
configure_git() {
logn "Configuring Git:"
if [ "$STRAP_CI" -gt 0 ]; then
git config --global commit.gpgsign false
git config --global gpg.format openpgp
fi
if [ -n "$STRAP_GIT_NAME" ] && ! git config user.name >/dev/null; then
git config --global user.name "$STRAP_GIT_NAME"
fi
if [ -n "$STRAP_GIT_EMAIL" ] && ! git config user.email >/dev/null; then
git config --global user.email "$STRAP_GIT_EMAIL"
fi
if [ -n "$STRAP_GITHUB_USER" ] &&
[ "$(git config github.user)" != "$STRAP_GITHUB_USER" ]; then
git config --global github.user "$STRAP_GITHUB_USER"
fi
# Set up GitHub HTTPS credentials
# shellcheck disable=SC2086
if git credential-osxkeychain 2>&1 | grep $Q "git.credential-osxkeychain"; then
# Execute credential in case it's a wrapper script for credential-osxkeychain
if git "credential-$(git config --global credential.helper 2>/dev/null)" 2>&1 |
grep -v $Q "git.credential-osxkeychain"; then
git config --global credential.helper osxkeychain
fi
if [ -n "$STRAP_GITHUB_USER" ] && [ -n "$STRAP_GITHUB_TOKEN" ]; then
PROTOCOL="protocol=https\\nhost=github.com"
printf "%s\\n" "$PROTOCOL" | git credential reject
printf "%s\\nusername=%s\\npassword=%s\\n" \
"$PROTOCOL" "$STRAP_GITHUB_USER" "$STRAP_GITHUB_TOKEN" |
git credential approve
else
log "Skipping Git credential setup."
fi
logk
fi
}
# The first call to `configure_git` is needed for cloning the dotfiles repo.
configure_git
# Check for and install any remaining software updates
logn "Checking for software updates:"
# shellcheck disable=SC2086
if softwareupdate -l 2>&1 | grep $Q "No new software available."; then
logk
else
if [ "$MACOS" -gt 0 ] && [ "$STRAP_CI" -eq 0 ]; then
echo
log "Installing software updates:"
sudo_askpass softwareupdate --install --all
check_xcode_license
else
log "Skipping software updates."
fi
logk
fi
# Experimental code: pass ssh passphrase to ssh-add command from env variable
# eval "$(ssh-agent -s)"
# SSH_ASKPASS_REQUIRE=force SSH_ASKPASS="$HOME/scripts/askpass.sh" ssh-add "$Q" "$HOME/.ssh/id_ed25519"
# Set up dotfiles
# shellcheck disable=SC2086
if [ ! -d "$HOME/.dotfiles" ]; then
if [ -z "$STRAP_DOTFILES_URL" ] || [ -z "$STRAP_DOTFILES_BRANCH" ]; then
abort "Please set STRAP_DOTFILES_URL and STRAP_DOTFILES_BRANCH."
fi
log "Cloning $STRAP_DOTFILES_URL to ~/.dotfiles."
git clone $Q "$STRAP_DOTFILES_URL" ~/.dotfiles
fi
strap_dotfiles_branch_name="${STRAP_DOTFILES_BRANCH##*/}"
log "Checking out $strap_dotfiles_branch_name in ~/.dotfiles."
# shellcheck disable=SC2086
(
cd ~/.dotfiles
git stash
git fetch $Q
git checkout "$strap_dotfiles_branch_name"
git pull $Q --rebase --autostash
)
logk
# The second call to `configure_git` is needed for CI use cases when certain
# aspects of the `.gitconfig` cannot be used (like signing commits with SSH).
# See commit c0542397e817fc1bd711984619eb73a6fdc937b2.
configure_git
# shellcheck disable=SC2086
install_homebrew() {
logn "Installing Homebrew:"
HOMEBREW_PREFIX="$(brew --prefix 2>/dev/null || true)"
[ -n "$HOMEBREW_PREFIX" ] || HOMEBREW_PREFIX="$DEFAULT_HOMEBREW_PREFIX"
[ -d "$HOMEBREW_PREFIX" ] || sudo_askpass mkdir -p "$HOMEBREW_PREFIX"
sudo_askpass chown "root:wheel" "$HOMEBREW_PREFIX" 2>/dev/null || true
(
cd "$HOMEBREW_PREFIX"
sudo_askpass mkdir -p \
Cellar Caskroom Frameworks bin etc include lib opt sbin share var
sudo_askpass chown "$USER:admin" \
Cellar Caskroom Frameworks bin etc include lib opt sbin share var
)
HOMEBREW_REPOSITORY="$(brew --repository 2>/dev/null || true)"
[ -n "$HOMEBREW_REPOSITORY" ] || HOMEBREW_REPOSITORY="$HOMEBREW_PREFIX/Homebrew"
[ -d "$HOMEBREW_REPOSITORY" ] || sudo_askpass mkdir -p "$HOMEBREW_REPOSITORY"
sudo_askpass chown -R "$USER:admin" "$HOMEBREW_REPOSITORY"
if [ "$HOMEBREW_PREFIX" != "$HOMEBREW_REPOSITORY" ]; then
ln -sf "$HOMEBREW_REPOSITORY/bin/brew" "$HOMEBREW_PREFIX/bin/brew"
fi
export GIT_DIR="$HOMEBREW_REPOSITORY/.git" GIT_WORK_TREE="$HOMEBREW_REPOSITORY"
git init $Q
git config remote.origin.url "https://github.com/Homebrew/brew"
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
git fetch $Q --tags --force
git reset $Q --hard origin/HEAD
unset GIT_DIR GIT_WORK_TREE
logk
export PATH="$HOMEBREW_PREFIX/bin:$PATH"
logn "Updating Homebrew:"
brew update
logk
}
set_up_brew_skips() {
local brewfile_path casks ci_skips mas_ids mas_prefix
log "Setting up Homebrew Bundle formula installs to skip."
ci_skips="awscli black jupyterlab mkvtoolnix zsh-completions"
[ "$STRAP_CI" -gt 0 ] && HOMEBREW_BUNDLE_BREW_SKIP="$ci_skips"
if [ -f "$HOME/.Brewfile" ]; then
brewfile_path="$HOME/.Brewfile"
elif [ -f "Brewfile" ]; then
brewfile_path="Brewfile"
else
abort "No Brewfile found"
fi
log "Setting up Homebrew Bundle cask installs to skip."
if [ "$MACOS" -gt 0 ] && [ "$brewfile_path" == "$HOME/.Brewfile" ]; then
casks="$(brew bundle list --global --cask --quiet | tr '\n' ' ')"
elif [ "$MACOS" -gt 0 ] && [ "$brewfile_path" == "Brewfile" ]; then
casks="$(brew bundle list --cask --quiet | tr '\n' ' ')"
else
log "Cask commands are only supported on macOS."
fi
HOMEBREW_BUNDLE_CASK_SKIP="${casks%% }"
log "Setting up Homebrew Bundle Mac App Store (mas) installs to skip."
mas_ids=""
mas_prefix='*mas*, id: '
while read -r brewfile_line; do
# shellcheck disable=SC2295
[[ $brewfile_line == *$mas_prefix* ]] && mas_ids+="${brewfile_line##$mas_prefix} "
done <"$brewfile_path"
HOMEBREW_BUNDLE_MAS_SKIP="${mas_ids%% }"
log "HOMEBREW_BUNDLE_BREW_SKIP='$HOMEBREW_BUNDLE_BREW_SKIP'"
log "HOMEBREW_BUNDLE_CASK_SKIP='$HOMEBREW_BUNDLE_CASK_SKIP'"
log "HOMEBREW_BUNDLE_MAS_SKIP='$HOMEBREW_BUNDLE_MAS_SKIP'"
export HOMEBREW_BUNDLE_BREW_SKIP="$HOMEBREW_BUNDLE_BREW_SKIP"
export HOMEBREW_BUNDLE_CASK_SKIP="$HOMEBREW_BUNDLE_CASK_SKIP"
export HOMEBREW_BUNDLE_MAS_SKIP="$HOMEBREW_BUNDLE_MAS_SKIP"
}
run_brew_installs() {
local brewfile_domain brewfile_path brewfile_url git_branch github_user
if ! command -v brew &>/dev/null; then
log "brew command not in shell environment. Attempting to load."
eval "$("$HOMEBREW_PREFIX"/bin/brew shellenv)"
command -v brew &>/dev/null && logk || return 1
fi
# Disable Homebrew Google Analytics: https://docs.brew.sh/Analytics
brew analytics off
[ "$STRAP_CI" -gt 0 ] || [ "$LINUX" -gt 0 ] && set_up_brew_skips
[ "$LINUX" -gt 0 ] && brew install gcc # "We recommend that you install GCC"
log "Running Homebrew installs."
if [ -f "$HOME/.Brewfile" ]; then
log "Installing from $HOME/.Brewfile with Brew Bundle."
brew bundle check --global || brew bundle --global
logk
elif [ -f "Brewfile" ]; then
log "Installing from local Brewfile with Brew Bundle."
brew bundle check || brew bundle
logk
else
[ -z "$STRAP_DOTFILES_BRANCH" ] && STRAP_DOTFILES_BRANCH=HEAD
git_branch="${STRAP_DOTFILES_BRANCH##*/}"
github_user="${STRAP_GITHUB_USER:-mettavi}"
brewfile_domain="https://raw.githubusercontent.com"
brewfile_path="$github_user/dotfiles/$git_branch/Brewfile"
brewfile_url="$brewfile_domain/$brewfile_path"
log "Installing from $brewfile_url with Brew Bundle."
curl -fsSL "$brewfile_url" | brew bundle --file=-
logk
fi
# Tap a custom Homebrew tap
if [ -n "$CUSTOM_HOMEBREW_TAP" ]; then
read -ra CUSTOM_HOMEBREW_TAP <<<"$CUSTOM_HOMEBREW_TAP"
log "Running 'brew tap ${CUSTOM_HOMEBREW_TAP[*]}':"
brew tap "${CUSTOM_HOMEBREW_TAP[@]}"
logk
fi
# Run a custom Brew command
if [ -n "$CUSTOM_BREW_COMMAND" ]; then
log "Executing 'brew $CUSTOM_BREW_COMMAND':"
# shellcheck disable=SC2086
brew $CUSTOM_BREW_COMMAND
logk
fi
}
# Install Homebrew: https://docs.brew.sh/Installation
script_url="https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh"
NONINTERACTIVE=$STRAP_CI \
/usr/bin/env bash -c "$(curl -fsSL $script_url)" || install_homebrew
# Set up Homebrew on Linux: https://docs.brew.sh/Homebrew-on-Linux
[ "$LINUX" -gt 0 ] && run_dotfile_scripts scripts/linuxbrew.sh
run_brew_installs || abort "Homebrew installs were not successful."
run_dotfile_scripts scripts/symlink.sh
run_dotfile_scripts scripts/strap-after-setup.sh
STRAP_SUCCESS=1
log "Your system is now bootstrapped!"