diff --git a/dotdrop/settings.py b/dotdrop/settings.py index 0bef2b3..bfc3ae6 100644 --- a/dotdrop/settings.py +++ b/dotdrop/settings.py @@ -49,7 +49,7 @@ class Settings(DictParser): upignore=[], cmpignore=[], instignore=[], workdir='~/.config/dotdrop', showdiff=False, minversion=None, func_file=[], filter_file=[], - diff_command='diff -r "{0}" "{1}"'): + diff_command='diff -r {0} {1}'): self.backup = backup self.banner = banner self.create = create diff --git a/dotdrop/utils.py b/dotdrop/utils.py index df073e6..689b4db 100644 --- a/dotdrop/utils.py +++ b/dotdrop/utils.py @@ -9,7 +9,6 @@ import subprocess import tempfile import os import uuid -import shlex import fnmatch import inspect import importlib @@ -71,12 +70,19 @@ def shell(cmd, debug=False): def diff(original, modified, raw=True, - diff_cmd='diff -r "{0}" "{1}"', debug=False): + diff_cmd='diff -r {0} {1}', debug=False): """compare two files""" if not diff_cmd: - diff_cmd = 'diff -r "{0}" "{1}"' - cmd = diff_cmd.format(original, modified) - _, out = run(shlex.split(cmd), raw=raw, debug=debug) + diff_cmd = 'diff -r {0} {1}' + + replacements = { + "{0}": original, + "{original}": original, + "{1}": modified, + "{modified}": modified, + } + cmd = [replacements.get(x, x) for x in diff_cmd.split()] + _, out = run(cmd, raw=raw, debug=debug) return out