aboutsummaryrefslogtreecommitdiffstats
path: root/bootstrap.sh
diff options
context:
space:
mode:
authorEugene Triguba <eugenetriguba@gmail.com>2023-09-28 21:44:38 -0400
committerEugene Triguba <eugenetriguba@gmail.com>2023-09-28 21:44:38 -0400
commit4ea645b9e69340009ee16498beb4dde267944193 (patch)
treee467fabf8352e95d4e2c68a75fd01391c9dcabad /bootstrap.sh
parentUpdate .zshrc for path env variables (diff)
downloaddotfiles-4ea645b9e69340009ee16498beb4dde267944193.zip
Add brewfile
Diffstat (limited to 'bootstrap.sh')
-rwxr-xr-xbootstrap.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/bootstrap.sh b/bootstrap.sh
new file mode 100755
index 0000000..f24e26b
--- /dev/null
+++ b/bootstrap.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+function install_homebrew() {
+ /usr/bin/env bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
+ (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> $HOME/.zprofile
+ eval "$(/opt/homebrew/bin/brew shellenv)"
+
+ homebrew_exists=$(command -v brew)
+ if test -z "$homebrew_exists"; then
+ echo "Failed to install homebrew"
+ exit 1
+ fi
+}
+
+has_homebrew=$(command -v brew)
+if test -z "$has_homebrew"; then
+ printf "I couldn't find a homebrew installation. Would you like to install homebrew? [y/n]: "
+ read answer
+ if [ "$answer" != "${answer#[Yy]}" ]; then
+ install_homebrew
+ else
+ echo "Exiting, can't continue without homebrew installed."
+ exit 0
+ fi
+fi
+
+echo "Found homebrew installation. Installing Brewfile.."
+brew bundle