From 298c6a549e071b67864892efeeadb7f009c315c1 Mon Sep 17 00:00:00 2001 From: deadc0de Date: Wed, 7 Feb 2018 17:08:38 +0100 Subject: [PATCH] Update README.md --- README.md | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d8ecf2d..0b804e6 100644 --- a/README.md +++ b/README.md @@ -323,17 +323,18 @@ be executed. ## Use transformations Transformation actions are used to transform a dotfile before it is -installed. They work like [actions](#use-actions) but have two arguments: +installed. They work like [actions](#use-actions) but are executed before the +dotfile is installed to transform the source. + +Transformation commands have two arguments: * **{0}** will be replaced with the dotfile to process -* **{1}** will be replaced with a temporary file to store the result +* **{1}** will be replaced with a temporary file to store the result of the transformation A typical use-case for transformations is when the dotfile needs to be stored encrypted. -For example: - -the transformation and the dotfile in `config.yaml`: +Here's an example of part of a config file to use gpg encrypted dotfiles: ``` dotfiles: f_secret: @@ -348,6 +349,23 @@ trans: The above config allows to store the dotfile `~/.secret` encrypted in the *dotfiles* directory and uses gpg to decrypt it when install is run. +Here's how to deploy the above solution: + +* import the clear dotfile (creates the entries in the config) +``` +./dotdrop.sh import ~/.secret +``` +* encrypt it and +``` + ~/.secret +``` +* overwrite the dotfile +``` +cp dotfiles/secret +``` +* edit the config file and add the transformation to the dotfile +* commit and push changes + ## Update dotdrop If used as a submodule, update it with