1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-11 13:44:16 +00:00

catch undefined profile

This commit is contained in:
deadc0de6
2022-08-24 20:53:30 +02:00
parent 2f7eacb7a9
commit da764f39ad
2 changed files with 7 additions and 0 deletions

View File

@@ -851,6 +851,9 @@ def _exec_command(opts):
LOG.dbg('running cmd: {}'.format(command)) LOG.dbg('running cmd: {}'.format(command))
cmd_remove(opts) cmd_remove(opts)
except UndefinedException as exc:
LOG.err(exc)
ret = False
except KeyboardInterrupt: except KeyboardInterrupt:
LOG.err('interrupted') LOG.err('interrupted')
ret = False ret = False

View File

@@ -16,6 +16,7 @@ from dotdrop.utils import strip_home, get_default_file_perms, \
from dotdrop.linktypes import LinkTypes from dotdrop.linktypes import LinkTypes
from dotdrop.comparator import Comparator from dotdrop.comparator import Comparator
from dotdrop.templategen import Templategen from dotdrop.templategen import Templategen
from dotdrop.exceptions import UndefinedException
class Importer: class Importer:
@@ -35,8 +36,11 @@ class Importer:
@debug: enable debug @debug: enable debug
@keepdot: keep dot prefix @keepdot: keep dot prefix
@ignore: patterns to ignore when importing @ignore: patterns to ignore when importing
This may raise UndefinedException
""" """
self.profile = profile self.profile = profile
if not self.profile:
raise UndefinedException("profile is undefined")
self.conf = conf self.conf = conf
self.dotpath = dotpath self.dotpath = dotpath
self.diff_cmd = diff_cmd self.diff_cmd = diff_cmd