1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-05 17:18:53 +00:00

implement recursive variables for #83

This commit is contained in:
deadc0de6
2019-02-02 20:16:44 +01:00
parent 45f29679b2
commit 8e9f1b2468
5 changed files with 197 additions and 15 deletions

View File

@@ -543,7 +543,8 @@ The second symlink method is a little more complicated. It creates a symlink in
`dst` for every file/directory in `src`.
### Why would I use `link_children`?
This feature can be very useful dotfiles such as vim where you may not want
This feature can be very useful for dotfiles such as vim where you may not want
plugins cluttering your dotfiles repository. First, the simpler `link: true` is
shown for comparison. With the `config.yaml` entry shown below, `~/.vim` gets
symlinked to `~/.dotfiles/vim/`. This means that using vim will now pollute the
@@ -793,6 +794,27 @@ Following template variables are available:
* defined variables (see [Variables](#variables))
* interpreted variables (see [Interpreted variables](#interpreted-variables))
All variables are recursively evaluated what means that
a config similar to:
```yaml
variables:
var1: "var1"
var2: "{{@@ var1 @@}} var2"
var3: "{{@@ var2 @@}} var3"
var4: "{{@@ dvar4 @@}}"
dynvariables:
dvar1: "echo dvar1"
dvar2: "{{@@ dvar1 @@}} dvar2"
dvar3: "{{@@ dvar2 @@}} dvar3"
dvar4: "echo {{@@ var3 @@}}"
```
will result in
* var3: `var1 var2 var3`
* dvar3: `dvar1 dvar2 dvar3`
* var4: `echo var1 var2 var3`
* dvar4: `var1 var2 var3`
## Variables
Variables can be added in the config file under the `variables` entry.