From e827927d71d30c093676d105b333639523043b6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Federico=20Fran=C3=A7ois?= Date: Sun, 22 Dec 2024 20:27:59 +0100 Subject: [PATCH] docs: add os related scripts --- .../docs/reference/special-directories/chezmoiscripts.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/assets/chezmoi.io/docs/reference/special-directories/chezmoiscripts.md b/assets/chezmoi.io/docs/reference/special-directories/chezmoiscripts.md index 5b24128d47c..119deb01518 100644 --- a/assets/chezmoi.io/docs/reference/special-directories/chezmoiscripts.md +++ b/assets/chezmoi.io/docs/reference/special-directories/chezmoiscripts.md @@ -3,3 +3,11 @@ If a directory called `.chezmoiscripts` exists in the root of the source directory then any scripts in it are executed as normal scripts without creating a corresponding directory in the target state. + +## OS related scripts + +If you have scripts that should only be executed on specific operating systems, you can avoid wrapping all instructions in templates by placing them in the following subdirectories within `.chezmoiscripts`: + +- `linux`: scripts in this directory will only be executed on Linux. +- `darwin`: scripts in this directory will only be executed on MacOS. +- `windows`: scripts in this directory will only be executed on Windows.