1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-09 00:14:16 +00:00

add force_chmod for #304

This commit is contained in:
deadc0de6
2021-03-15 07:49:09 +01:00
parent faa7846155
commit 82569b3057
8 changed files with 23 additions and 9 deletions

View File

@@ -66,7 +66,7 @@ class Installer:
def install(self, templater, src, dst, linktype,
actionexec=None, noempty=False,
ignore=[], is_template=True,
chmod=None):
chmod=None, force_chmod=False):
"""
install src to dst
@@ -79,6 +79,7 @@ class Installer:
@ignore: pattern to ignore when installing
@is_template: this dotfile is a template
@chmod: rights to apply if any
@force_chmod: do not ask user to chmod
return
- True, None : success
@@ -171,7 +172,7 @@ class Installer:
if dstperms != chmod:
# apply mode
msg = 'chmod {} to {:o}'.format(dst, chmod)
if self.safe and not self.log.ask(msg):
if not force_chmod and self.safe and not self.log.ask(msg):
r = False
err = 'aborted'
else: