1
0
mirror of https://github.com/Foltik/dotfiles synced 2024-11-30 22:42:11 -05:00
dotfiles/lib/diff.py

12 lines
309 B
Python
Raw Normal View History

2018-12-09 00:46:03 -05:00
import lib.proc as proc
def diff(file1, file2):
2018-12-09 01:06:47 -05:00
cmd = ['diff', '-r', str(file1), str(file2)]
2018-12-09 00:46:03 -05:00
subproc = proc.exec(cmd)
delta = proc.communicate(subproc, cmd, [0, 1])
ret = str(file1) + ' vs ' + str(file2) + ': '
ret += delta if delta != '' else 'Files are identical.'
return ret