From 239f80222818a5cbecbe697ba6abbcf26567708f Mon Sep 17 00:00:00 2001 From: deadc0de6 Date: Sun, 2 Jun 2019 11:57:57 +0200 Subject: [PATCH] disable trans_{r,w} when linked --- dotdrop/dotfile.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dotdrop/dotfile.py b/dotdrop/dotfile.py index 7f3f5c3..ea6a384 100644 --- a/dotdrop/dotfile.py +++ b/dotdrop/dotfile.py @@ -49,6 +49,18 @@ class Dotfile(DictParser): raise Exception('only one trans_write allowed') self.upignore = upignore + if link != LinkTypes.NOLINK and \ + ( + (trans_r and len(trans_r) > 0) + or + (trans_w and len(trans_w) > 0) + ): + msg = '[{}] transformations disabled'.format(key) + msg += ' because dotfile is linked' + self.log.warn(msg) + trans_r = [] + trans_w = [] + def get_dotfile_variables(self): """return this dotfile specific variables""" return {