SuperCuber / dotter

A dotfile manager and templater written in rust 🦀
The Unlicense
882 stars 46 forks source link

[FEATURE] Built in dotfiles folder varable #97

Closed SIMULATAN closed 2 years ago

SIMULATAN commented 2 years ago

Is your feature request related to a problem? Please describe. I want to modify the alias specified by the default .zshrc to modify the file in the dotfiles directory and not the target one.

Describe the solution you'd like A built-in dotter.dotfiles_folder variable that has the absolute path to the root of the dotfiles folder

Alternatives I tried to make my own pre-deploy hook with the code

{{assign "dotfiles_folder" (command_output "pwd")}}

but unfortunately it can't find the variable (the assignement worked, I can use it in the line below as seen in the screenshot) screenshot code

Thank you for the great work, I absolutely love the tool and would be very happy to see updates :heart:

SuperCuber commented 2 years ago

Yep I don't think you can use assign for this because it works on a per-file basis in handlebars.

Should be easy enough to add, PRs welcome but I will get to it over the next couple of days otherwise

For reference the relevant code is here https://github.com/SuperCuber/dotter/blob/98b747f2b6859bd9188fbb15f552530b1a28d3aa/src/handlebars_helpers.rs#L295 probably best to name it something like root so that it's available in dotter.root

SIMULATAN commented 2 years ago

Thanks!

Unfortunately I don't really have experience in rust but I'll see what I can do.

SuperCuber commented 2 years ago

Implemented in https://github.com/SuperCuber/dotter/commit/1582b58bea715e70506f247e4cf505ad09be0d0f , to be included in next release.