Skip to content

Commit

Permalink
fix for --recursive option
Browse files Browse the repository at this point in the history
  • Loading branch information
vnitinv committed Jul 18, 2016
1 parent 897d23f commit 77cddd9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions icdiff.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def diff(a, b, options=None):
options = get_options()[0]
def print_meta(s):
codec_print(simple_colorize(s, "magenta"), options)

if os.path.isfile(a) and os.path.isfile(b):
if not filecmp.cmp(a, b, shallow=False):
diff_files(options, a, b)
Expand All @@ -555,9 +555,8 @@ def print_meta(s):
elif child not in a_contents:
print_meta("Only in %s: %s" % (b, child))
elif options.recursive:
diff(options,
os.path.join(a, child),
os.path.join(b, child))
diff(os.path.join(a, child),
os.path.join(b, child), options)
elif os.path.isdir(a) and os.path.isfile(b):
print_meta("File %s is a directory while %s is a file" % (a, b))

Expand Down

0 comments on commit 77cddd9

Please sign in to comment.