diff --git a/.config/yadm/bootstrap##template b/.config/yadm/bootstrap##template index dd4929f..462ac49 100755 --- a/.config/yadm/bootstrap##template +++ b/.config/yadm/bootstrap##template @@ -1,14 +1,22 @@ #!/bin/bash - # WARNING: Do not edit this file. # It was generated by processing {{ yadm.source }} -# Save this file as ~/.config/yadm/bootstrap and make it executable. It will -# execute all executable files (excluding templates and editor backups) in the -# ~/.config/yadm/bootstrap.d directory when run. - set -eu +{% if yadm.os == "Darwin" %} +# install homebrew if it's missing +if ! command -v brew >/dev/null 2>&1; then +echo "Installing homebrew" +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" +fi + +if [ -f "$HOME/.Brewfile" ]; then +echo "Updating homebrew bundle" +brew bundle --global +fi +{% endif %} + # Directory to look for bootstrap executables in BOOTSTRAP_D="${BASH_SOURCE[0]}.d"