mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-09 12:19:17 +00:00
ensuire the link flag is set from the start
This commit is contained in:
@@ -259,9 +259,6 @@ def cmd_importer(opts, conf, paths):
|
|||||||
|
|
||||||
# create a new dotfile
|
# create a new dotfile
|
||||||
dotfile = Dotfile('', dst, src)
|
dotfile = Dotfile('', dst, src)
|
||||||
linkit = opts['link_by_default']
|
|
||||||
if opts['link']:
|
|
||||||
linkit = not linkit
|
|
||||||
if opts['debug']:
|
if opts['debug']:
|
||||||
LOG.dbg('new dotfile: {}'.format(dotfile))
|
LOG.dbg('new dotfile: {}'.format(dotfile))
|
||||||
|
|
||||||
@@ -280,7 +277,7 @@ def cmd_importer(opts, conf, paths):
|
|||||||
cmd = ['cp', '-R', '-L', dst, srcf]
|
cmd = ['cp', '-R', '-L', dst, srcf]
|
||||||
if opts['dry']:
|
if opts['dry']:
|
||||||
LOG.dry('would run: {}'.format(' '.join(cmd)))
|
LOG.dry('would run: {}'.format(' '.join(cmd)))
|
||||||
if linkit:
|
if opts['link']:
|
||||||
LOG.dry('would symlink {} to {}'.format(srcf, dst))
|
LOG.dry('would symlink {} to {}'.format(srcf, dst))
|
||||||
else:
|
else:
|
||||||
r, _ = run(cmd, raw=False, debug=opts['debug'], checkerr=True)
|
r, _ = run(cmd, raw=False, debug=opts['debug'], checkerr=True)
|
||||||
@@ -288,11 +285,11 @@ def cmd_importer(opts, conf, paths):
|
|||||||
LOG.err('importing \"{}\" failed!'.format(path))
|
LOG.err('importing \"{}\" failed!'.format(path))
|
||||||
ret = False
|
ret = False
|
||||||
continue
|
continue
|
||||||
if linkit:
|
if opts['link']:
|
||||||
remove(dst)
|
remove(dst)
|
||||||
os.symlink(srcf, dst)
|
os.symlink(srcf, dst)
|
||||||
retconf, dotfile = conf.new(dotfile, opts['profile'],
|
retconf, dotfile = conf.new(dotfile, opts['profile'],
|
||||||
link=linkit, debug=opts['debug'])
|
link=opts['link'], debug=opts['debug'])
|
||||||
if retconf:
|
if retconf:
|
||||||
LOG.sub('\"{}\" imported'.format(path))
|
LOG.sub('\"{}\" imported'.format(path))
|
||||||
cnt += 1
|
cnt += 1
|
||||||
@@ -436,7 +433,9 @@ def main():
|
|||||||
opts['profile'] = args['--profile']
|
opts['profile'] = args['--profile']
|
||||||
opts['safe'] = not args['--force']
|
opts['safe'] = not args['--force']
|
||||||
opts['installdiff'] = not args['--nodiff']
|
opts['installdiff'] = not args['--nodiff']
|
||||||
opts['link'] = args['--inv-link']
|
opts['link'] = opts['link_by_default']
|
||||||
|
if args['--inv-link']:
|
||||||
|
opts['link'] = not opts['link']
|
||||||
opts['debug'] = args['--verbose']
|
opts['debug'] = args['--verbose']
|
||||||
opts['variables'] = conf.get_variables(opts['profile'])
|
opts['variables'] = conf.get_variables(opts['profile'])
|
||||||
opts['showdiff'] = opts['showdiff'] or args['--showdiff']
|
opts['showdiff'] = opts['showdiff'] or args['--showdiff']
|
||||||
|
|||||||
Reference in New Issue
Block a user