mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-08 23:39:16 +00:00
update action doc
This commit is contained in:
@@ -1,7 +1,13 @@
|
|||||||
## Entry actions
|
## Entry actions
|
||||||
|
|
||||||
**Note**: any action with a key starting with an underscore (`_`) won't be shown in output.
|
Actions can be either `post` or `pre`
|
||||||
This can be useful when working with sensitive data containing passwords for example.
|
|
||||||
|
* `post` action will be executed after the dotfile deployment
|
||||||
|
* `pre` action will be executed before the dotfile deployment
|
||||||
|
|
||||||
|
If you don't specify neither `post` nor `pre`, the action will be executed
|
||||||
|
after the dotfile deployment (which is equivalent to `post`).
|
||||||
|
Actions cannot obviously be named `pre` or `post`.
|
||||||
|
|
||||||
Four types of actions can be defined:
|
Four types of actions can be defined:
|
||||||
|
|
||||||
@@ -10,6 +16,9 @@ Four types of actions can be defined:
|
|||||||
* [Profile actions](#profile-actions)
|
* [Profile actions](#profile-actions)
|
||||||
* [Fake dotfiles and actions](#fake-dotfile-and-actions)
|
* [Fake dotfiles and actions](#fake-dotfile-and-actions)
|
||||||
|
|
||||||
|
**Note**: any action with a key starting with an underscore (`_`) won't be shown in output.
|
||||||
|
This can be useful when working with sensitive data containing passwords for example.
|
||||||
|
|
||||||
### Dotfile actions
|
### Dotfile actions
|
||||||
|
|
||||||
It is sometimes useful to execute some kind of action
|
It is sometimes useful to execute some kind of action
|
||||||
@@ -85,11 +94,8 @@ actions:
|
|||||||
some-action: echo "Hello, World!" >/tmp/log
|
some-action: echo "Hello, World!" >/tmp/log
|
||||||
```
|
```
|
||||||
|
|
||||||
If you don't specify neither `post` nor `pre`, the action will be executed
|
|
||||||
after the dotfile deployment (which is equivalent to `post`).
|
|
||||||
Actions cannot obviously be named `pre` or `post`.
|
|
||||||
|
|
||||||
Actions can even be parameterized. For example:
|
Actions can even be parameterized. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
actions:
|
actions:
|
||||||
echoaction: echo '{0}' > {1}
|
echoaction: echo '{0}' > {1}
|
||||||
@@ -121,7 +127,7 @@ when xinitrc is installed.
|
|||||||
|
|
||||||
### Default actions
|
### Default actions
|
||||||
|
|
||||||
Dotdrop allows to execute an action for any dotfile installation. These actions work as any other action (*pre* or *post*).
|
Dotdrop allows to execute an action for any dotfile installation. These actions work as any other action (`pre` or `post`).
|
||||||
|
|
||||||
For example, the below action will log each dotfile installation to a file.
|
For example, the below action will log each dotfile installation to a file.
|
||||||
|
|
||||||
@@ -147,8 +153,8 @@ profiles:
|
|||||||
|
|
||||||
### Profile actions
|
### Profile actions
|
||||||
|
|
||||||
Profile can be either `pre` or `post` actions. Those are executed before
|
A profile action can be either `pre` or `post` action (see [actions](config-details.md#entry-actions)).
|
||||||
any dotfile installation (for `pre`) and after all dotfiles installation (for `post`)
|
Those are executed before any dotfile installation (for `pre`) and after all dotfiles installation (for `post`)
|
||||||
only if at least one dotfile has been installed.
|
only if at least one dotfile has been installed.
|
||||||
|
|
||||||
### Fake dotfile and actions
|
### Fake dotfile and actions
|
||||||
|
|||||||
@@ -118,6 +118,20 @@ actions:
|
|||||||
<action-key>: <command-to-execute>
|
<action-key>: <command-to-execute>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
*pre* actions
|
||||||
|
```yaml
|
||||||
|
actions:
|
||||||
|
pre:
|
||||||
|
<action-key>: <command-to-execute>
|
||||||
|
```
|
||||||
|
|
||||||
|
*post* actions
|
||||||
|
```yaml
|
||||||
|
actions:
|
||||||
|
post:
|
||||||
|
<action-key>: <command-to-execute>
|
||||||
|
```
|
||||||
|
|
||||||
### trans_read entry
|
### trans_read entry
|
||||||
|
|
||||||
The **trans_read** entry (optional) contains a list of transformations (see [transformations](config-details.md#entry-transformations))
|
The **trans_read** entry (optional) contains a list of transformations (see [transformations](config-details.md#entry-transformations))
|
||||||
|
|||||||
Reference in New Issue
Block a user