From 96870ac2977114e064ccf9c264c0007634a1a42a Mon Sep 17 00:00:00 2001 From: Marcel Robitaille Date: Sun, 27 Jan 2019 12:58:20 -0400 Subject: [PATCH] Save LinkType enum in opts --- dotdrop/dotdrop.py | 8 ++------ tests/helpers.py | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dotdrop/dotdrop.py b/dotdrop/dotdrop.py index 8c8f123..9aa5fba 100644 --- a/dotdrop/dotdrop.py +++ b/dotdrop/dotdrop.py @@ -262,13 +262,9 @@ def cmd_importer(opts, conf, paths): # create a new dotfile dotfile = Dotfile('', dst, src) - linktype = LinkTypes.NOLINK - if opts['link_by_default']: - linktype = LinkTypes.PARENTS - elif opts['link_children']: - linktype = LinkTypes.CHILDREN + linktype = LinkTypes(opts['link']) - if opts['link'] and linktype == LinkTypes.PARENTS: + if opts['link_by_default'] and linktype == LinkTypes.PARENTS: linktype = LinkTypes.NOLINK else: linktype = LinkTypes.PARENTS diff --git a/tests/helpers.py b/tests/helpers.py index be55796..d1f3ee4 100644 --- a/tests/helpers.py +++ b/tests/helpers.py @@ -12,6 +12,7 @@ import tempfile from dotdrop.config import Cfg from dotdrop.utils import * +from dotdrop.linktypes import LinkTypes TMPSUFFIX = '.dotdrop' @@ -87,8 +88,7 @@ def load_config(confpath, profile): opts['profile'] = profile opts['safe'] = True opts['installdiff'] = True - opts['link'] = False - opts['link_children'] = False + opts['link'] = LinkTypes.NOLINK.value opts['showdiff'] = True opts['debug'] = True opts['dopts'] = ''