Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

nydragon
Copy link

@nydragon nydragon commented Dec 24, 2023

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" }

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:

```toml
[sway.files.fish]
file = "fish/conf.d/sway.fish"
target = "~/.config/fish/conf.d/sway.fish"
type = "symbolic"
```

```toml
[sway.files]
fish = { target = "~/.config/fish/conf.d/sway.fish", type = "symbolic", file = "fish/conf.d/sway.fish" }
```
@SuperCuber
Copy link
Owner

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...

@nydragon
Copy link
Author

nydragon commented Feb 18, 2024

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"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants