From 7a355e626d6749926a9a7f52122bb60a983fadd0 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Mon, 4 Mar 2024 23:50:08 +0200 Subject: [PATCH] add install_brew.sh --- Makefile | 5 ++--- macos/install_brew.sh | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100755 macos/install_brew.sh diff --git a/Makefile b/Makefile index 1a92d2c..fed7fef 100644 --- a/Makefile +++ b/Makefile @@ -10,12 +10,11 @@ link: -ln -s ~/Git/dotfiles/.tmux.conf ~ brew: - -sh -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" - -brew bundle --file ./macos/Brewfile + -./macos/install_brew.sh -sudo chsh -s /usr/local/bin/bash cask: - brew bundle --file ./macos/Caskfile + -brew bundle --file ./macos/Caskfile cask_personal: -brew bundle --file ./macos/Caskfile.personal diff --git a/macos/install_brew.sh b/macos/install_brew.sh new file mode 100755 index 0000000..2e89969 --- /dev/null +++ b/macos/install_brew.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +# Check for Homebrew and install if missing +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)"' >> $HOME/.bash_profile.local + eval "$(/opt/homebrew/bin/brew shellenv)" +fi + +brew update + +brew tap homebrew/bundle + +brew bundle --file ./macos/Brewfile