1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-06 10:48:00 +00:00

fix import and debug for travis

This commit is contained in:
deadc0de6
2019-06-24 22:28:09 -04:00
parent a13a96b68b
commit 01597c9c24
4 changed files with 19 additions and 16 deletions

View File

@@ -354,16 +354,18 @@ def cmd_importer(o):
# prepare hierarchy for dotfile
srcf = os.path.join(o.dotpath, src)
overwrite = not os.path.exists(srcf)
if o.safe and os.path.exists(srcf):
c = Comparator(debug=o.debug)
diff = c.compare(srcf, dst)
if diff != '':
# files are different, dunno what to do
LOG.log('diff \"{}\" VS \"{}\"'.format(dst, srcf))
LOG.emph(diff)
# ask user
msg = 'Dotfile \"{}\" already exists, overwrite?'.format(srcf)
overwrite = LOG.ask(msg)
if os.path.exists(srcf):
overwrite = True
if o.safe:
c = Comparator(debug=o.debug)
diff = c.compare(srcf, dst)
if diff != '':
# files are different, dunno what to do
LOG.log('diff \"{}\" VS \"{}\"'.format(dst, srcf))
LOG.emph(diff)
# ask user
msg = 'Dotfile \"{}\" already exists, overwrite?'
overwrite = LOG.ask(msg.format(srcf))
if o.debug:
LOG.dbg('will overwrite: {}'.format(overwrite))