Reinstall the module if its directory was deleted
Useful for stupid users (like me) who delete the directory.
This commit is contained in:
parent
764bfd18ec
commit
22fec7f9e6
1 changed files with 2 additions and 2 deletions
|
|
@ -499,8 +499,9 @@ class Repositories(object):
|
|||
if info.is_local():
|
||||
raise ModuleInstallError('%s is available on local.' % info.name)
|
||||
|
||||
module_dir = os.path.join(self.modules_dir, info.name)
|
||||
installed = self.versions.get(info.name)
|
||||
if installed is None:
|
||||
if installed is None or not os.path.exists(module_dir):
|
||||
progress.progress(0.3, 'Module is not installed yet')
|
||||
elif info.version > installed:
|
||||
progress.progress(0.3, 'A new version of this module is available')
|
||||
|
|
@ -517,7 +518,6 @@ class Repositories(object):
|
|||
progress.progress(0.7, 'Setting up module...')
|
||||
|
||||
# Extract module from tarball.
|
||||
module_dir = os.path.join(self.modules_dir, info.name)
|
||||
if os.path.isdir(module_dir):
|
||||
shutil.rmtree(module_dir)
|
||||
with closing(tarfile.open('', 'r:gz', fp)) as tar:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue