mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-05 21:58:02 +00:00
@@ -353,7 +353,23 @@ def cmd_importer(o):
|
||||
|
||||
# prepare hierarchy for dotfile
|
||||
srcf = os.path.join(o.dotpath, src)
|
||||
if not os.path.exists(srcf):
|
||||
overwrite = not os.path.exists(srcf)
|
||||
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))
|
||||
if overwrite:
|
||||
cmd = ['mkdir', '-p', '{}'.format(os.path.dirname(srcf))]
|
||||
if o.dry:
|
||||
LOG.dry('would run: {}'.format(' '.join(cmd)))
|
||||
|
||||
@@ -52,7 +52,7 @@ USAGE = """
|
||||
|
||||
Usage:
|
||||
dotdrop install [-VbtfndDa] [-c <path>] [-p <profile>] [<key>...]
|
||||
dotdrop import [-Vbd] [-c <path>] [-p <profile>]
|
||||
dotdrop import [-Vbdf] [-c <path>] [-p <profile>]
|
||||
[-l <link>] <path>...
|
||||
dotdrop compare [-Vb] [-c <path>] [-p <profile>]
|
||||
[-o <opts>] [-C <file>...] [-i <pattern>...]
|
||||
|
||||
Reference in New Issue
Block a user