From 5b1dbb5f1a3d9752bb4201e64ae6a4ea51754222 Mon Sep 17 00:00:00 2001 From: Ruslan Sayfutdinov Date: Sat, 12 Oct 2024 00:02:25 +0100 Subject: [PATCH] docs: Add example for running script on macOS update --- assets/chezmoi.io/docs/user-guide/machines/macos.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/assets/chezmoi.io/docs/user-guide/machines/macos.md b/assets/chezmoi.io/docs/user-guide/machines/macos.md index 7a39df3c5a6..3e78a85f5e2 100644 --- a/assets/chezmoi.io/docs/user-guide/machines/macos.md +++ b/assets/chezmoi.io/docs/user-guide/machines/macos.md @@ -34,3 +34,12 @@ machine is connected to. For a stable result, use the `scutil` command: ``` {{ $computerName := output "scutil" "--get" "ComputerName" | trim }} ``` + +## Run script after every macOS update + +You can automate a script to run after each macOS update by creating +a `run_onchange_` script and using the `output` template function to run `sw_vers`: + +``` +# MacOS build version: {{ output "sw_vers" "--buildVersion" }} +```