add homebrew preinstall script

This commit is contained in:
Yuan Chiu 2025-04-23 17:30:18 +08:00
parent 03376d997f
commit 1b043aa6f9
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,16 @@
packages:
darwin:
brews:
- 'chozmoi'
- 'git'
- 'vim'
- 'lsix'
- 'eza'
- 'grc'
- 'cmake'
- 'python'
- 'go'
- 'nodejs'
- 'java'
casks:
- 'iterm2'

View File

@ -0,0 +1,16 @@
{{ if eq .chezmoi.os "darwin" -}}
#!/bin/bash
# Install Homebrew
command -v brew >/dev/null 2>&1 || \
(echo '🍺 Installing Homebrew' && /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)")
brew bundle --file=/dev/stdin <<EOF
{{ range .packages.darwin.brews -}}
brew {{ . | quote }}
{{ end -}}
{{ range .packages.darwin.casks -}}
cask {{ . | quote }}
{{ end -}}
EOF
{{ end -}}