From 72fdfde6043149054e8c36a0ffc96280021abac1 Mon Sep 17 00:00:00 2001 From: David John Date: Mon, 14 Aug 2017 03:26:23 +0100 Subject: [PATCH] Filecmp for not deleting, see issue #133 --- plugins/link.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugins/link.py b/plugins/link.py index 4b50320..18ec7cf 100644 --- a/plugins/link.py +++ b/plugins/link.py @@ -1,6 +1,7 @@ import os import shutil import dotbot +import filecmp class Link(dotbot.Plugin): @@ -102,6 +103,9 @@ class Link(dotbot.Plugin): fullpath = os.path.expanduser(path) if relative: source = self._relative_path(source, fullpath) + if filecmp.cmp(source, fullpath) + self._log_lowinfo('Not changing unchanged file %s' % path) + return success if ((self._is_link(path) and self._link_destination(path) != source) or (self._exists(path) and not self._is_link(path))): removed = False