Skip to content

Commit

Permalink
Handle plugin install failures better
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Warrick <kwpolska@gmail.com>
  • Loading branch information
Kwpolska committed Jan 8, 2017
1 parent 7207adc commit c2da98c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions nikola/plugins/command/plugin.py
Expand Up @@ -286,11 +286,14 @@ def do_install(self, url, name, show_install_notes=True):
if os.path.exists(req_plug_path):
LOGGER.notice('This plugin requires other Nikola plugins.')
LOGGER.info('Installing plugins...')
plugin_failure = False
try:
with io.open(req_plug_path, 'r', encoding='utf-8') as inf:
for plugname in inf.readlines():
self.do_install(url, plugname, show_install_notes)
except subprocess.CalledProcessError:
plugin_failure = self.do_install(url, plugname, show_install_notes) != 0
except Exception:
plugin_failure = True
if plugin_failure:
LOGGER.error('Could not install a plugin.')
print('Contents of the requirements-plugins.txt file:\n')
with io.open(req_plug_path, 'r', encoding='utf-8') as fh:
Expand Down

0 comments on commit c2da98c

Please sign in to comment.