dotter icon indicating copy to clipboard operation
dotter copied to clipboard

[FEATURE] Always copy

Open marie-bnl opened this issue 2 years ago • 7 comments

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

It would be nice to be able to just always copy the files instead of symlinking.

Describe the solution you'd like

I think that with dotter's current architecture, the most sensible parameter would be a --copy command-line flag

Describe alternatives you've considered

A technically working (well, not even, see #77) solution would be to add the "template" type to all files. It goes without saying this is not a viable solution.

marie-bnl avatar Feb 12 '23 23:02 marie-bnl

Could you tell more about the use case?

SuperCuber avatar Feb 13 '23 10:02 SuperCuber

I think this is a basic feature and I don't know if the use case is relevant but sure!

Well in my case it has to do with #77; I have files to put in root directories (sddm config), and symlinking it to a user directory is a bit odd. As mentionned I don't want to add the template type to the file, I'd like to keep the config simple.

Plus, I just don't like having a mix of symlinks and copies on my system, I'd rather just copy all files.

marie-bnl avatar Feb 13 '23 11:02 marie-bnl

Another use case for this feature would be for people on Windows. While Windows (through Developer Mode) does support symbolic links, these are not well supported by other applications. Most notably here is One Drive which simply hangs indefinitely when it encounters a symbolic link.

I noticed that there's already logic to switch to copy-only mode if symbolic links are disabled:

https://github.com/SuperCuber/dotter/blob/1e649ab8f2cd4103d81e3cbf367cd599ae71e5d1/src/deploy.rs#L66-L78

Would be it possible to leverage that with a --copy command line parameter, or the ability to customise a windows.toml file so that all files are copied over?

JP-Ellis avatar Apr 04 '23 22:04 JP-Ellis

Yes that would work. However there are two problems left:

  • It's probably annoying to specify --copy each time, so it would be better to specify it in local.toml or an include. Maybe a new section for [settings]
  • If you have non utf8 files then they cannot be templated. The "copy target type" feature would solve that, but I don't have the bandwidth to add it

SuperCuber avatar Apr 05 '23 08:04 SuperCuber

I agree that using --copy all the time would be annoying.

I note there already are ways of having OS-specific configuration which get imported as part of the local.toml definition. I think using this so that on Windows I can have copy = True would be already great.

JP-Ellis avatar Apr 06 '23 00:04 JP-Ellis

To me, both would do the job

marie-bnl avatar Apr 06 '23 16:04 marie-bnl