From 1b043aa6f955252c287d50e753d7f24c076b52ff Mon Sep 17 00:00:00 2001 From: Yuan Chiu Date: Wed, 23 Apr 2025 17:30:18 +0800 Subject: [PATCH] add homebrew preinstall script --- .chezmoidata/packages.yaml | 16 ++++++++++++++++ run_onchange_darwin-install-packages.sh.tmpl | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 .chezmoidata/packages.yaml create mode 100644 run_onchange_darwin-install-packages.sh.tmpl diff --git a/.chezmoidata/packages.yaml b/.chezmoidata/packages.yaml new file mode 100644 index 0000000..2a2a2e1 --- /dev/null +++ b/.chezmoidata/packages.yaml @@ -0,0 +1,16 @@ +packages: + darwin: + brews: + - 'chozmoi' + - 'git' + - 'vim' + - 'lsix' + - 'eza' + - 'grc' + - 'cmake' + - 'python' + - 'go' + - 'nodejs' + - 'java' + casks: + - 'iterm2' \ No newline at end of file diff --git a/run_onchange_darwin-install-packages.sh.tmpl b/run_onchange_darwin-install-packages.sh.tmpl new file mode 100644 index 0000000..4d96f57 --- /dev/null +++ b/run_onchange_darwin-install-packages.sh.tmpl @@ -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 <