#!/usr/bin/env bash

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

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

if command -v brew > /dev/null; then
  logg 'Installing base dependencies for macOS using `brew bundle`'
  logg info 'Dependencies: asdf jq node glow go-task/tap/go-task gum volta yq m-cli zx'
  logg info 'GNU compatibility dependencies: coreutils findutils gawk gnu-getopt gnu-indent gnu-tar gnu-sed gnutls grep'

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