suppress empty dict printing when no duplicates found
This commit is contained in:
parent
42202b901b
commit
30620884c9
1 changed files with 3 additions and 1 deletions
|
@ -133,7 +133,9 @@ def main():
|
||||||
|
|
||||||
if action == 'print':
|
if action == 'print':
|
||||||
dups = file_dups(topdirs, args['--digest-alg'], args['--block-size'])
|
dups = file_dups(topdirs, args['--digest-alg'], args['--block-size'])
|
||||||
print(json.dumps(dict(dups), indent=4))
|
spam = dict(dups)
|
||||||
|
if spam:
|
||||||
|
print(json.dumps(spam, indent=4))
|
||||||
elif action == 'move':
|
elif action == 'move':
|
||||||
mv_file_dups(topdirs, args['--digest-alg'], args['--block-size'],
|
mv_file_dups(topdirs, args['--digest-alg'], args['--block-size'],
|
||||||
args['--move'])
|
args['--move'])
|
||||||
|
|
Loading…
Reference in a new issue