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

adding ability to pass arguments to diff

This commit is contained in:
deadc0de6
2017-12-28 17:58:13 +01:00
parent e2cc16bee9
commit ddbcbafeac
5 changed files with 17 additions and 9 deletions

View File

@@ -7,6 +7,7 @@ utilities
import subprocess
import tempfile
import os
import shlex
from shutil import rmtree
# local import
@@ -28,8 +29,9 @@ def run(cmd, log=False, raw=True):
return ''.join(lines)
def diff(src, dst, log=False, raw=True):
return run(['diff', '-r', src, dst], log=log, raw=raw)
def diff(src, dst, log=False, raw=True, opts=''):
cmd = 'diff -r %s \"%s\" \"%s\"' % (opts, src, dst)
return run(shlex.split(cmd), log=log, raw=raw)
def get_tmpdir():