SuperCuber / dotter

A dotfile manager and templater written in rust 🦀
The Unlicense
900 stars 48 forks source link

Are the complex templates read from local.toml overwritten the global one by default? #174

Open ulic-youthlic opened 5 months ago

ulic-youthlic commented 5 months ago

Environment

If applicable, provide the following details:

The question

If I have a part of the complex template configuration in global.toml that is public and I just want to change the target of this template, can i write all the configuration in global.toml and just the following in the local.toml?

[my_package.files.my_template]
target = "path/to/local/file"

i had a try, but seems the new blank template in local.toml will cover the global one, and result is a blank template.

SuperCuber commented 5 months ago

Could you also send the global.toml file? To see what you're trying to override. If you have other properties for the complex template in the global.toml you will need to re-specify them in the local.toml The assumption you don't does make sense but it doesn't work that way currently :(

ulic-youthlic commented 5 months ago

Thanks for the reply, I already know what you mean. As for why I did that, I can give you an example: I need to append a line to the profile to make my configuration take effect, so I used a complex. i wrote this template inside global.toml. However, the location of the profile is different on different machines, so I need to override the template's target attribute, which I put in local.toml. This is my usage scenario. If you ask me why I don't just add the profile to the repo, I'll tell you that PowerShell config needs some of the local part as well. thx.