kelseyhightower / confd

Manage local application configuration files using templates and data from etcd or consul
MIT License
8.36k stars 1.41k forks source link

Use environment variables in dest #495

Open bborysenko opened 8 years ago

bborysenko commented 8 years ago
bbo:dotfiles/ (master✗) $ cat ./conf.d/git.toml                                           [3:01:40]
[template]
src = "gitconfig.tmpl"
dest = "$HOME/gitconfig-"
keys = [
    "/git/user/name",
    "/git/user/email",
]%                                                                                                  

bbo:dotfiles/ (master✗) $ GIT_USER_EMAIL=sdsd GIT_USER_NAME=SDSD confd -onetime -backend env -confdir=.
2016-10-25T03:03:07+03:00 adams.local confd[7981]: INFO Backend set to env
2016-10-25T03:03:07+03:00 adams.local confd[7981]: INFO Starting confd
2016-10-25T03:03:07+03:00 adams.local confd[7981]: INFO Backend nodes set to
2016-10-25T03:03:07+03:00 adams.local confd[7981]: ERROR open $HOME/.gitconfig-862339413: no such file or directory
HeavyHorst commented 8 years ago

I don't think that kelsey want to support this. There where several issues already: #79 #229 #344

bborysenko commented 8 years ago

Maybe add support for dest = "~/gitconfig" at least?

I'm looking for way to manage user' dotfiles with confd and to be able use reload_cmd. For instance to run brew bundle if a Brewfile has been changed.

Right now I just use some piece of bash to:

But actually I don't like this way.

HeavyHorst commented 8 years ago

@bborysenko dest = "~/gitconfig" and dest = "$HOME/gitconfig" would both be really easy to implement. I would put together a pull request if i would know that it is going to be merged.

I also needed some features which kelsey did not wanted in confd - so i created https://github.com/HeavyHorst/remco, maybe this is fitting your needs better.