MCPcopy
hub / github.com/deadc0de6/dotdrop / diff

Function diff

dotdrop/utils.py:99–113  ·  view source on GitHub ↗

compare two files, returns '' if same

(original, modified,
         diff_cmd='', debug=False)

Source from the content-addressed store, hash-verified

97
98
99def diff(original, modified,
100 diff_cmd='', debug=False):
101 """compare two files, returns '' if same"""
102 if not diff_cmd:
103 diff_cmd = 'diff -r -u {0} {1}'
104
105 replacements = {
106 "{0}": original,
107 "{original}": original,
108 "{1}": modified,
109 "{modified}": modified,
110 }
111 cmd = [replacements.get(x, x) for x in diff_cmd.split()]
112 _, out = run(cmd, debug=debug)
113 return out
114
115
116def get_tmpdir():

Callers 2

_diffMethod · 0.90
_handle_dirMethod · 0.90

Calls 2

runFunction · 0.85
getMethod · 0.80

Tested by

no test coverage detected