From df7bec8f9049f88031910e89f03f4c365eb27a3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Ole=20H=C3=BCbner?= Date: Sun, 13 Apr 2025 03:25:42 +0200 Subject: [PATCH] feat(install): add brew installation and Brewfile install --- .zshrc.d/install_dotfiles.zsh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/.zshrc.d/install_dotfiles.zsh b/.zshrc.d/install_dotfiles.zsh index 811978c..f324c07 100644 --- a/.zshrc.d/install_dotfiles.zsh +++ b/.zshrc.d/install_dotfiles.zsh @@ -21,10 +21,29 @@ install_dotfiles () { fi if [[ ! -d ~/.oh-my-zsh ]]; then - sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended --keep-zshrc + sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended --keep-zshrc git clone --depth=1 https://github.com/romkatv/powerlevel10k.git $HOME/.oh-my-zsh/themes/powerlevel10k fi + # Path to Brewfile + BREWFILE="$HOME/.Brewfile" + + if ! command -v brew &>/dev/null; then + echo "Homebrew not found. Installing..." + + if [[ "$OSTYPE" == "darwin"* ]]; then + + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + + if [[ -f "$BREWFILE" ]]; then + echo "Installing from Brewfile: $BREWFILE" + brew bundle --file="$BREWFILE" + else + echo "No Brewfile found at $BREWFILE" + fi + fi + fi }