1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-04 16:49:42 +00:00

correct retcode is returned with compare

This commit is contained in:
deadc0de6
2018-02-05 16:40:49 +01:00
parent e72cd3aa1e
commit 9b021ca39e

View File

@@ -133,6 +133,10 @@ def compare(opts, conf, tmp, focus=None):
else:
LOG.err('no dotfile matches \"%s\"' % (selection))
if len(selected) < 1:
return True
ret = True
for dotfile in selected:
same, diff = inst.compare(t, tmp, opts['profile'],
dotfile.src, dotfile.dst,
@@ -145,8 +149,9 @@ def compare(opts, conf, tmp, focus=None):
else:
LOG.log('diffing \"%s\" VS \"%s\"' % (dotfile.key, dotfile.dst))
LOG.emph(diff)
ret = False
return len(selected) > 0
return ret
def update(opts, conf, path):
@@ -300,7 +305,8 @@ def main():
# compare local dotfiles with dotfiles stored in dotdrop
tmp = get_tmpdir()
opts['dopts'] = args['--dopts']
if compare(opts, conf, tmp, args['--files']):
ret = compare(opts, conf, tmp, args['--files'])
if ret:
LOG.raw('\ntemporary files available under %s' % (tmp))
else:
os.rmdir(tmp)