mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 14:31:46 +00:00
fail early when profile does not exist (#300)
This commit is contained in:
@@ -419,6 +419,10 @@ def cmd_update(o):
|
||||
paths = o.update_path
|
||||
iskey = o.update_iskey
|
||||
|
||||
if o.profile not in [p.key for p in o.profiles]:
|
||||
LOG.err('no such profile \"{}\"'.format(o.profile))
|
||||
return False
|
||||
|
||||
adapt_workers(o, LOG)
|
||||
|
||||
if not paths:
|
||||
|
||||
@@ -95,6 +95,16 @@ class Updater:
|
||||
dtpath = os.path.join(self.dotpath, dotfile.src)
|
||||
dtpath = os.path.expanduser(dtpath)
|
||||
|
||||
if not os.path.exists(path):
|
||||
msg = '\"{}\" does not exist'
|
||||
self.log.err(msg.format(path))
|
||||
return False
|
||||
|
||||
if not os.path.exists(dtpath):
|
||||
msg = '\"{}\" does not exist, import it first'
|
||||
self.log.err(msg.format(dtpath))
|
||||
return False
|
||||
|
||||
if self._ignore([path, dtpath]):
|
||||
self.log.sub('\"{}\" ignored'.format(dotfile.key))
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user