Skip to content

Commit

Permalink
docs: Elaborate on once vs onchange attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
dslatkin authored and twpayne committed Sep 19, 2022
1 parent bb8d579 commit 0f58586
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions assets/chezmoi.io/docs/reference/source-state-attributes.md
Expand Up @@ -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 |
| ---------- | --------------------------------------------------- |
Expand Down

0 comments on commit 0f58586

Please sign in to comment.