Skip to content

Commit

Permalink
fix sub chmod
Browse files Browse the repository at this point in the history
  • Loading branch information
deadc0de6 committed Sep 22, 2023
1 parent 77450c1 commit cf8bd39
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dotdrop/installer.py
Expand Up @@ -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):
"""
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cf8bd39

Please sign in to comment.