Closed Lilja closed 1 year ago
Hello, as described in the doc, the following appends on install:
chmod
is specified in the dotfile, it will be applied to the installed dotfile.force_chmod
is set to true
, dotdrop will not ask for confirmation to apply permissions.So in your case, the permission of the file <dotpath>/wezterm
should be applied to /mnt/c/Users/Erik\ Lilja
, probably that directory permission is 755
in the dotpath.
But you want dotdrop to NOT touch the permission if that directory already exists, since it may be changed outside dotdrop, correct?
Of course you could force the permission you want with chmod: <something>
. Most people do want that if the directory permission changes outside of dotdrop it is restored by dotdrop (based on the chmod
entry or the directory permissions in the dotpath).
We could for example add a special value to the chmod
entry like chmod: -
to mean that no change of permission should occur on install. In case the directory does not exist it would get 777. Would that solve your use-case?
We could for example add a special value to the chmod entry like chmod: - to mean that no change of permission should occur on install. In case the directory does not exist it would get 777. Would that solve your use-case?
Yes, I think that would work
Cool, I'll implement it and will keep you posted.
@Lilja I added a new special value to chmod
: preserve
. This should tell install
and update
not to mess with existing files permissions if set.
It is tracked in the chmod-preserve branch. The doc is here.
I couldn't go with -
since this is a reserved keyword in yaml.
Could you give it a try?
Tried it out, worked fine!
The new feature is now available in version 1.12.1.
What I am trying to achieve I just added a new dotfile that installs from my WSL image to my host machine. The config goes something like this:
When I run it, dotdrop tries to
chmod
the file to755
. I don't like how dotdrop tries to change that, and I saw that you could put the desired chmod octal. But in this scenario, that octal could change and since its affecting a quite important directory I don't want it to perform any side effects.What I have tried so far put
chmod: 777
on that dotfile, but I think it's a shaky solution