deadc0de6 / dotdrop

Save your dotfiles once, deploy them everywhere
https://dotdrop.readthedocs.io
GNU General Public License v3.0
1.79k stars 105 forks source link

[feature] #304

Closed MarcelRobitaille closed 3 years ago

MarcelRobitaille commented 3 years ago

A recent commit added the feature of setting chmod on installed dotfiles. I don't need this, and as a result, a lot of my dotfiles don't have the chmod set correctly. There should be an option to turn this on and off globally, and for individual dotfiles.

I am willing to make a PR. Just wanted to talk with you about the best way to do it.

deadc0de6 commented 3 years ago

The chmod feature (introduced with v1.4.0) is applied only if you have it enabled (see the related doc).

If you don't have any chmod entry in your config file, the behavior is the same as before the chmod feature (installing the dotfiles will copy the permission as it did before the feature). If you have the chmod entry and it doesn't match what you want then you can remove the entry in your config or adapt it to what you want.

chmod entries might have been automatically added during an update (when the permissions on the filesystem differ from the file in your dotpath). Again this is the same behavior as before the chmod feature since before that feature, update would already copy the file permission (only difference is that no chmod entry would be added then).

Can you provide me with an example where the behavior is not as explained above. In which case I would of course fix the bug.

MarcelRobitaille commented 3 years ago

Ok, maybe it wasn't added with that feature, but I still think there should be a way to turn off the prompt to change permissions. I guess the behaviour for me is one that you described, but even if I import a file, I might not care about tracking its permissions. I see your point though. I'll try to update the permissions of my dots.

deadc0de6 commented 3 years ago

I see, your point is about dotdrop asking you if you want to change the file permission on install (when they differ). Yes this was added with the feature and wasn't there before (it would simply transparently apply permissions w/o asking).

You should be able to avoid that by using -f --force but I agree that this is not optimal. Of course I could add a new config settings that would always apply chmod without asking, something like force_chmod for example.

Would that solve your issue?

deadc0de6 commented 3 years ago

I have added the global setting force_chmod to avoid getting confirmation when applying permission on install. Setting it to true in your config file should solve your issue.

deadc0de6 commented 3 years ago

@MarcelRobitaille I'm closing this hoping the above fix worked for you. Feel free to re-open if you need anything else.