Closed RayZ0rr closed 2 years ago
No, unfortunately it is not possible to use variables in dotpath
. A list of elements of the config where variables can be used is listed here. Can you tell me more on your use-case/need, maybe we can work something out if that's something you need.
I'm however surprised by the second error you get since I cannot reproduce it. Whenever I use a variable in dotpath
then simply the variable is not expanded and file is not found. I'm guessing you have an issue in a different part of your config file.
Yes, the second error was a problem with my config.
For, the first one I just thought I can keep my config file anywhere and not on the same directory as config.yaml
exists. I was initially planning to give it like this: dotpath: "{{@@ env['HOME'] @@}}/gitfolder"
but this is not really a big problem. Actually this is not even a inconvenience so I rather not turn this into a feature. I am very happy with how dotdrop works and wouldn't want to risk it breaking from minor features like this.
@RayZ0rr I added support for templating the dotpath
entry. The following would work:
config:
dotpath: "{{@@ env['SOME_VAR'] @@}}"
or
config:
dotpath: "{{@@ val @@}}"
variables:
val: "/tmp/xyz"
This will be part of the next release
@RayZ0rr this is now available in version v1.9.0
What I am trying to achieve I have an environment variable in
.bashrc
like this:I want to use it with my dotdrop config like this:
But this environmental variable doesn't get evaluated,
Then I changed it like this:
But I get the error:
Is it possible to use variables here?