#!/usr/bin/env bash

# darwin/Brewfile hash: {{ include (joinPath ".chezmoitemplates" "darwin" "Brewfile") | sha256sum }}

{{ includeTemplate "universal/profile-before" }}
{{ includeTemplate "universal/logg-before" }}

if command -v brew > /dev/null; then
  logg 'Installing base dependencies for macOS using `brew bundle`'
  logg info 'Dependencies: age asdf jq node glow go go-task/tap/go-task gnupg gum m-cli progress volta yq m-cli yq zx'
  logg info 'GNU compatibility dependencies: coreutils findutils'

  brew bundle --verbose --no-lock --file=/dev/stdin <<EOF
  {{ includeTemplate "darwin/Brewfile" . -}}
  EOF
else
  logg error '`brew` was not found in the PATH'
fi