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.