Filecmp for not deleting, see issue #133
This commit is contained in:
parent
fe9ca6f5ed
commit
72fdfde604
1 changed files with 4 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import shutil
|
import shutil
|
||||||
import dotbot
|
import dotbot
|
||||||
|
import filecmp
|
||||||
|
|
||||||
|
|
||||||
class Link(dotbot.Plugin):
|
class Link(dotbot.Plugin):
|
||||||
|
@ -102,6 +103,9 @@ class Link(dotbot.Plugin):
|
||||||
fullpath = os.path.expanduser(path)
|
fullpath = os.path.expanduser(path)
|
||||||
if relative:
|
if relative:
|
||||||
source = self._relative_path(source, fullpath)
|
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
|
if ((self._is_link(path) and self._link_destination(path) != source) or
|
||||||
(self._exists(path) and not self._is_link(path))):
|
(self._exists(path) and not self._is_link(path))):
|
||||||
removed = False
|
removed = False
|
||||||
|
|
Loading…
Reference in a new issue