1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 07:18:01 +00:00

add chmod to import command

This commit is contained in:
deadc0de6
2020-11-09 13:36:48 +01:00
parent fc53ea23ce
commit fc9c12c1b0
6 changed files with 72 additions and 13 deletions

View File

@@ -22,7 +22,7 @@ class Dotfile(DictParser):
actions=[], trans_r=None, trans_w=None,
link=LinkTypes.NOLINK, noempty=False,
cmpignore=[], upignore=[],
instignore=[], template=True):
instignore=[], template=True, chmod=None):
"""
constructor
@key: dotfile key
@@ -37,6 +37,7 @@ class Dotfile(DictParser):
@cmpignore: patterns to ignore when comparing
@instignore: patterns to ignore when installing
@template: template this dotfile
@chmod: file permission
"""
self.actions = actions
self.dst = dst
@@ -50,6 +51,7 @@ class Dotfile(DictParser):
self.cmpignore = cmpignore
self.instignore = instignore
self.template = template
self.chmod = chmod
if self.link != LinkTypes.NOLINK and \
(
@@ -113,6 +115,7 @@ class Dotfile(DictParser):
msg += ', dst:\"{}\"'.format(self.dst)
msg += ', link:\"{}\"'.format(str(self.link))
msg += ', template:{}'.format(self.template)
msg += ', chmod:{}'.format(self.chmod)
return msg
def prt(self):
@@ -123,6 +126,7 @@ class Dotfile(DictParser):
out += '\n{}dst: \"{}\"'.format(indent, self.dst)
out += '\n{}link: \"{}\"'.format(indent, str(self.link))
out += '\n{}template: \"{}\"'.format(indent, str(self.template))
out += '\n{}chmod: \"{}\"'.format(indent, str(self.chmod))
out += '\n{}pre-action:'.format(indent)
some = self.get_pre_actions()