mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-16 17:20:16 +00:00
Merge branch 'master' of github.com:deadc0de6/dotdrop
This commit is contained in:
@@ -16,8 +16,12 @@ 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.
|
**Notes**:
|
||||||
This can be useful when working with sensitive data containing passwords for example.
|
|
||||||
|
* 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.
|
||||||
|
* Make sure to quote your actions to avoid bad surprises
|
||||||
|
* Actions are executed using the default shell (`$SHELL`)
|
||||||
|
* To use shell variables in your actions you need to escape the curly brackets (`${HOME}` becomes `${{HOME}}`)
|
||||||
|
|
||||||
### Dotfile actions
|
### Dotfile actions
|
||||||
|
|
||||||
@@ -181,8 +185,12 @@ For examples of transformation uses, see
|
|||||||
* [Handle compressed directories](howto/store-compressed-directories.md)
|
* [Handle compressed directories](howto/store-compressed-directories.md)
|
||||||
* [Handle secrets](howto/sensitive-dotfiles.md)
|
* [Handle secrets](howto/sensitive-dotfiles.md)
|
||||||
|
|
||||||
**Note**: any transformation with a key starting with an underscore (`_`) won't be shown in output.
|
**Notes**:
|
||||||
This can be useful when working with sensitive data containing passwords for example.
|
|
||||||
|
* Any transformation 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.
|
||||||
|
* Make sure to quote your transformations to avoid bad surprises
|
||||||
|
* Transformations are executed using the default shell (`$SHELL`)
|
||||||
|
* To use shell variables in your transformations you need to escape the curly brackets (`${HOME}` becomes `${{HOME}}`)
|
||||||
|
|
||||||
There are two types of transformations available:
|
There are two types of transformations available:
|
||||||
|
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ actions:
|
|||||||
preaction: echo 'pre' > ${tmpa}/pre
|
preaction: echo 'pre' > ${tmpa}/pre
|
||||||
preaction2: echo 'pre2' > ${tmpa}/pre2
|
preaction2: echo 'pre2' > ${tmpa}/pre2
|
||||||
fake_pre: echo 'fake pre' > ${tmpa}/fake_pre
|
fake_pre: echo 'fake pre' > ${tmpa}/fake_pre
|
||||||
|
expandvariable: "myvar=xxx; echo \${{myvar}} > ${tmpa}/expandvariable"
|
||||||
post:
|
post:
|
||||||
postaction: echo 'post' > ${tmpa}/post
|
postaction: echo 'post' > ${tmpa}/post
|
||||||
postaction2: echo 'post2' > ${tmpa}/post2
|
postaction2: echo 'post2' > ${tmpa}/post2
|
||||||
@@ -84,6 +85,7 @@ dotfiles:
|
|||||||
- preaction2
|
- preaction2
|
||||||
- postaction2
|
- postaction2
|
||||||
- _silentaction
|
- _silentaction
|
||||||
|
- expandvariable
|
||||||
f_fake:
|
f_fake:
|
||||||
dst:
|
dst:
|
||||||
src:
|
src:
|
||||||
@@ -119,6 +121,8 @@ grep post ${tmpa}/post2 >/dev/null
|
|||||||
grep "executing \"echo 'naked' > ${tmpa}/naked" ${tmpa}/log >/dev/null
|
grep "executing \"echo 'naked' > ${tmpa}/naked" ${tmpa}/log >/dev/null
|
||||||
grep "executing \"echo 'silent'" ${tmpa}/log >/dev/null && false
|
grep "executing \"echo 'silent'" ${tmpa}/log >/dev/null && false
|
||||||
grep "executing silent action \"_silentaction\"" ${tmpa}/log >/dev/null
|
grep "executing silent action \"_silentaction\"" ${tmpa}/log >/dev/null
|
||||||
|
[ ! -e ${tmpa}/expandvariable ] && exit 1
|
||||||
|
grep xxx ${tmpa}/expandvariable >/dev/null
|
||||||
|
|
||||||
# fake action
|
# fake action
|
||||||
[ ! -e ${tmpa}/fake ] && echo 'fake post action not executed' && exit 1
|
[ ! -e ${tmpa}/fake ] && echo 'fake post action not executed' && exit 1
|
||||||
|
|||||||
Reference in New Issue
Block a user