dotter icon indicating copy to clipboard operation
dotter copied to clipboard

feat(config): adding the option to explicitly state the source file

Open nydragon opened this issue 2 years ago • 2 comments

Hey,

I like to mirror the structure of the config directory in my dotfiles, and I encountered an issue when I had to use a complex target. This problem was that my path couldn't be used as a toml section ([sway.files."fish/conf.d/sway.fish"]). So I made the following change:

-- Commit Body --

This modification allows to specify the source file in a "file" key for complex targets. Using this key overrides the path deduced from the TOML section header or the TOML key.

Examples:

[sway.files.fish]
source = "fish/conf.d/sway.fish"
target = "~/.config/fish/conf.d/sway.fish"
type = "symbolic"
[sway.files]
fish = { target = "~/.config/fish/conf.d/sway.fish", type = "symbolic", source = "fish/conf.d/sway.fish" }

nydragon avatar Dec 24 '23 09:12 nydragon

Finally got around to knocking some issues out. Could you explain why the path can't be used as a toml section? The syntax you posted looks like it would work...

SuperCuber avatar Feb 17 '24 15:02 SuperCuber

Thanks for taking your time to check my PR, I confirm that it does work... I can't remember what exactly the error was, I might have misread something.

But maybe it could still make some sense to include the modification as I think that [sway.files.fish] is more legible than [sway.files."fish/conf.d/sway.fish"]

nydragon avatar Feb 18 '24 01:02 nydragon