From 883fa10471ed9aaa89168f3c0675f658027ba5ad Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 8 Mar 2021 13:19:26 +0100 Subject: [PATCH 1/2] add test for #303 --- tests-ng/actions.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests-ng/actions.sh b/tests-ng/actions.sh index dd202d1..a5805d4 100755 --- a/tests-ng/actions.sh +++ b/tests-ng/actions.sh @@ -63,6 +63,7 @@ actions: preaction: echo 'pre' > ${tmpa}/pre preaction2: echo 'pre2' > ${tmpa}/pre2 fake_pre: echo 'fake pre' > ${tmpa}/fake_pre + expandvariable: "myvar=xxx; echo \${{myvar}} > ${tmpa}/expandvariable" post: postaction: echo 'post' > ${tmpa}/post postaction2: echo 'post2' > ${tmpa}/post2 @@ -84,6 +85,7 @@ dotfiles: - preaction2 - postaction2 - _silentaction + - expandvariable f_fake: dst: src: @@ -119,6 +121,8 @@ grep post ${tmpa}/post2 >/dev/null grep "executing \"echo 'naked' > ${tmpa}/naked" ${tmpa}/log >/dev/null grep "executing \"echo 'silent'" ${tmpa}/log >/dev/null && false grep "executing silent action \"_silentaction\"" ${tmpa}/log >/dev/null +[ ! -e ${tmpa}/expandvariable ] && exit 1 +grep xxx ${tmpa}/expandvariable >/dev/null # fake action [ ! -e ${tmpa}/fake ] && echo 'fake post action not executed' && exit 1 From 712ef3005fba66e8bc548c6d7e43e95e2c4c4a63 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Mon, 8 Mar 2021 13:24:48 +0100 Subject: [PATCH 2/2] update doc for #303 --- docs/config-details.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/config-details.md b/docs/config-details.md index ce26260..6494068 100644 --- a/docs/config-details.md +++ b/docs/config-details.md @@ -16,8 +16,12 @@ Four types of actions can be defined: * [Profile actions](#profile-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. +**Notes**: + +* 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 @@ -181,8 +185,12 @@ For examples of transformation uses, see * [Handle compressed directories](howto/store-compressed-directories.md) * [Handle secrets](howto/sensitive-dotfiles.md) -**Note**: 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. +**Notes**: + +* 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: