Skip to content

[FEATURE] Allow more information to be specified about the target of a file #18

@SuperCuber

Description

@SuperCuber

Is your feature request related to a problem? Please describe.
I want to be able to perform operations other than overwriting a file or variable in local.toml, for example appending certain text to it for machine-specific bashrc configuration for example.
Another use-case would be to specify the type of the file in global.toml.

Describe the solution you'd like

[package.files]
my_file = {}

A file mapped to an object with some description of the action wanted.
An idea off the top of my head: {"action": "append", "text": "echo hello world!"}

Describe alternatives you've considered
The current workaround for this is to implement that behavior myself in the source file in an {{if}} block and then toggle that on in the machine's local.toml and off in all other local.tomls.

  • Update documentation when this is implemented
  • Think about how merging two target objects should work
    local.toml will just overwrite the whole value currently. I thought about making it merge in certain cases (for example specifying append in global and prepend in local) but this seems like too narrow of a use-case to matter.
  • When this is done, open an issue for this to also work on folders (?)
    I don't think this is important in folders, so I won't be doing this for now at least.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions