From cf8bd39597a3eadf581665b4c26f400524c336d3 Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Fri, 22 Sep 2023 11:29:01 +0200 Subject: [PATCH] fix sub chmod --- dotdrop/installer.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dotdrop/installer.py b/dotdrop/installer.py index 2b176b49..d1a10d91 100644 --- a/dotdrop/installer.py +++ b/dotdrop/installer.py @@ -190,6 +190,7 @@ def install(self, templater, src, dst, linktype, def _apply_chmod_after_install(self, src, dst, ret, err, chmod=None, + is_sub=False, force_chmod=False, linktype=LinkTypes.NOLINK): """ @@ -200,11 +201,15 @@ def _apply_chmod_after_install(self, src, dst, ret, err, - error (not r, err) - aborted (not r, err) - special keyword "preserve" + is_sub is used to specify if the file/dir is + part of a dotfile directory """ apply_chmod = linktype in [LinkTypes.NOLINK, LinkTypes.LINK_CHILDREN] apply_chmod = apply_chmod and os.path.exists(dst) apply_chmod = apply_chmod and (ret or (not ret and not err)) apply_chmod = apply_chmod and chmod != CfgYaml.chmod_ignore + if is_sub: + chmod = None if not apply_chmod: self.log.dbg('no chmod applied') return @@ -620,7 +625,7 @@ def _copy_dir(self, templater, src, dst, return res, err self._apply_chmod_after_install(fpath, fdst, ret, err, - chmod=chmod) + chmod=chmod, is_sub=True) if res: # something got installed