From f8802ea1ac6b4fba2301f113bf23dcf6a60418fe Mon Sep 17 00:00:00 2001 From: Marcel Robitaille Date: Sat, 26 Jan 2019 20:25:08 -0400 Subject: [PATCH] Invert link with `--link` flag (#80) --- dotdrop/dotdrop.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index c408c0a..8c8f123 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -263,11 +263,16 @@ def cmd_importer(opts, conf, paths): dotfile = Dotfile('', dst, src) linktype = LinkTypes.NOLINK - if opts['link'] or opts['link_by_default']: + if opts['link_by_default']: linktype = LinkTypes.PARENTS elif opts['link_children']: linktype = LinkTypes.CHILDREN + if opts['link'] and linktype == LinkTypes.PARENTS: + linktype = LinkTypes.NOLINK + else: + linktype = LinkTypes.PARENTS + if opts['debug']: LOG.dbg('new dotfile: {}'.format(dotfile))