mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-15 18:30:05 +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"""
|
"""link all dotfiles in a given directory"""
|
||||||
self.action_executed = False
|
self.action_executed = False
|
||||||
parent = os.path.join(self.base, os.path.expanduser(src))
|
parent = os.path.join(self.base, os.path.expanduser(src))
|
||||||
|
|
||||||
|
# Fail if source doesn't exist
|
||||||
if not os.path.exists(parent):
|
if not os.path.exists(parent):
|
||||||
self.log.err('source dotfile does not exist: {}'.format(parent))
|
self.log.err('source dotfile does not exist: {}'.format(parent))
|
||||||
return []
|
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))
|
dst = os.path.normpath(os.path.expanduser(dst))
|
||||||
if not os.path.lexists(dst):
|
if not os.path.lexists(dst):
|
||||||
self.log.sub('creating directory "{}"'.format(dst))
|
self.log.sub('creating directory "{}"'.format(dst))
|
||||||
|
|||||||
Reference in New Issue
Block a user