mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-04 20:54:51 +00:00
Fail if source isn't a directory
This commit is contained in:
@@ -84,10 +84,18 @@ class Installer:
|
||||
"""link all dotfiles in a given directory"""
|
||||
self.action_executed = False
|
||||
parent = os.path.join(self.base, os.path.expanduser(src))
|
||||
|
||||
# Fail if source doesn't exist
|
||||
if not os.path.exists(parent):
|
||||
self.log.err('source dotfile does not exist: {}'.format(parent))
|
||||
return []
|
||||
|
||||
# Fail if source not a directory
|
||||
if not os.path.isdir(parent):
|
||||
self.log.err('source dotfile is not a directory: {}'
|
||||
.format(parent))
|
||||
return []
|
||||
|
||||
dst = os.path.normpath(os.path.expanduser(dst))
|
||||
if not os.path.lexists(dst):
|
||||
self.log.sub('creating directory "{}"'.format(dst))
|
||||
|
||||
Reference in New Issue
Block a user