From b95c95f908c9362b6eef47ca081ebc5e949f051d Mon Sep 17 00:00:00 2001 From: Marcus Crane Date: Mon, 8 Jan 2024 13:48:09 +1300 Subject: [PATCH] Save packages as markdown file + publish to docs site Signed-off-by: Marcus Crane --- run_once_01_packages-darwin.sh.tmpl | 1 + run_once_01_packages-darwin.sh.tmpl.md | 188 +++++++++++++++++++++++++ setup-site.sh | 2 +- 3 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 run_once_01_packages-darwin.sh.tmpl.md diff --git a/run_once_01_packages-darwin.sh.tmpl b/run_once_01_packages-darwin.sh.tmpl index eded76a..f3f6eb0 100644 --- a/run_once_01_packages-darwin.sh.tmpl +++ b/run_once_01_packages-darwin.sh.tmpl @@ -169,3 +169,4 @@ qlmanage -r >/dev/null 2>&1 || true && echo "~~ quicklook extensions have been c # ln -sf /Applications/Postgres.app/Contents/Versions/latest/bin/pg_config /usr/local/bin/pg_config {{ end -}} + diff --git a/run_once_01_packages-darwin.sh.tmpl.md b/run_once_01_packages-darwin.sh.tmpl.md new file mode 100644 index 0000000..e05c853 --- /dev/null +++ b/run_once_01_packages-darwin.sh.tmpl.md @@ -0,0 +1,188 @@ +--- +title: Homebrew Packages +category: scripts +tags: +- applications +- shell +output: run_once_01_packages-darwin.sh.tmpl +--- + +This script uses `brew bundle` to install various macOS packages. + +The reason that it is done inline instead of using a Brewfile is because Chezmoi basically hashes the script to determine whether it needs to be rerun again or not. + +Inlining packages means that adding or removing files causes the script to be rerun as the hash will compute differently. + +```bash +{{- if (eq .chezmoi.os "darwin") -}} +#!/usr/bin/env bash + +echo "~ homebrew" + +brew bundle --quiet --no-lock --file=/dev/stdin </dev/null 2>&1 || true && echo "~~ quicklook extensions have been configured" + +# Used to fix a PHP compilation issue +# ln -sf /Applications/Postgres.app/Contents/Versions/latest/bin/pg_config /usr/local/bin/pg_config + +{{ end -}} +``` \ No newline at end of file diff --git a/setup-site.sh b/setup-site.sh index 2b24f54..b9ec6b1 100755 --- a/setup-site.sh +++ b/setup-site.sh @@ -6,10 +6,10 @@ mkdir docs # Intro cp README.md docs - # Root Home Directory ($HOME) cp sqliterc.md docs cp zshrc.md docs +cp run_once_01_packages-darwin.sh.tmpl.md docs # SSH (~/.ssh) mkdir -p docs/home/ssh