From 0f58586f49ae5b7f1aefe25d846e6d1531694035 Mon Sep 17 00:00:00 2001 From: Daniel Slatkin Date: Mon, 19 Sep 2022 14:33:15 -0700 Subject: [PATCH] docs: Elaborate on once vs onchange attributes --- .../docs/reference/source-state-attributes.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/assets/chezmoi.io/docs/reference/source-state-attributes.md b/assets/chezmoi.io/docs/reference/source-state-attributes.md index ecaf19177cd..2ac5e66c6a9 100644 --- a/assets/chezmoi.io/docs/reference/source-state-attributes.md +++ b/assets/chezmoi.io/docs/reference/source-state-attributes.md @@ -11,25 +11,25 @@ names. The following prefixes and suffixes are special, and are collectively referred to as "attributes": -| Prefix | Effect | -| ------------- | ------------------------------------------------------------------------------ | -| `after_` | Run script after updating the destination | -| `before_` | Run script before updating the destination | -| `create_` | Ensure that the file exists, and create it with contents if it does not | -| `dot_` | Rename to use a leading dot, e.g. `dot_foo` becomes `.foo` | -| `empty_` | Ensure the file exists, even if is empty. By default, empty files are removed | -| `encrypted_` | Encrypt the file in the source state | -| `exact_` | Remove anything not managed by chezmoi | -| `executable_` | Add executable permissions to the target file | -| `literal_` | Stop parsing prefix attributes | -| `modify_` | Treat the contents as a script that modifies an existing file | -| `once_` | Only run the script if it has not been run before | -| `onchange_` | Only run the script if its contents have changed from the last time it was run | -| `private_` | Remove all group and world permissions from the target file or directory | -| `readonly_` | Remove all write permissions from the target file or directory | -| `remove_` | Remove the file or symlink if it exists or the directory if it is empty | -| `run_` | Treat the contents as a script to run | -| `symlink_` | Create a symlink instead of a regular file | +| Prefix | Effect | +| ------------- | ----------------------------------------------------------------------------------- | +| `after_` | Run script after updating the destination | +| `before_` | Run script before updating the destination | +| `create_` | Ensure that the file exists, and create it with contents if it does not | +| `dot_` | Rename to use a leading dot, e.g. `dot_foo` becomes `.foo` | +| `empty_` | Ensure the file exists, even if is empty. By default, empty files are removed | +| `encrypted_` | Encrypt the file in the source state | +| `exact_` | Remove anything not managed by chezmoi | +| `executable_` | Add executable permissions to the target file | +| `literal_` | Stop parsing prefix attributes | +| `modify_` | Treat the contents as a script that modifies an existing file | +| `once_` | Only run the script if its contents have not been run before | +| `onchange_` | Only run the script if its contents have not been run before with the same filename | +| `private_` | Remove all group and world permissions from the target file or directory | +| `readonly_` | Remove all write permissions from the target file or directory | +| `remove_` | Remove the file or symlink if it exists or the directory if it is empty | +| `run_` | Treat the contents as a script to run | +| `symlink_` | Create a symlink instead of a regular file | | Suffix | Effect | | ---------- | --------------------------------------------------- |