Skip to content

[FEATURE] Configure overwrite for symbolic targets #200

@quambene

Description

@quambene

Is your feature request related to a problem? Please describe.

Often, the target file already exists on a system that was just set up. For example, ~/.bashrc already exists which requires dotter deploy --force. Though I would prefer not to apply force to all targets.

Describe the solution you'd like

For this reason, a forced overwrite should be configurable per target.

It's already possible to configure the type per target:

[bash.files]
bashrc = { target = "~/.bashrc", type = "symbolic" }

It should also be possible to overwrite the existing file, which could look like this:

[bash.files]
bashrc = { target = "~/.bashrc", type = "symbolic", overwrite = "force" }

An alternative configuration is:

[bash.files]
bashrc = { target = "~/.bashrc", type = "symbolic_overwrite" }

Describe alternatives you've considered

An alternative to achieve the same is to run dotter deploy twice. In particular:

  1. Create all targets as symbolic links: dotter deploy
  2. Now also replace existing targets which failed in the first step: dotter deploy --force

Happy to contribute if this feature makes sense to you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions