Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix #2356
  • Loading branch information
ralsina committed Jun 3, 2016
1 parent 6cf7744 commit 296fef7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGES.txt
Expand Up @@ -11,6 +11,7 @@ Features
Bugfixes
--------

* Fix plugin removal for plugins that are a package (Issue #2356)
* Reload English messages for every theme to prevent caching (Issue #2347)
* Cache theme messages after loading once (Issue #2344)
* Add ``<link>`` tags to other languages even if the post is
Expand Down
13 changes: 8 additions & 5 deletions nikola/plugins/command/plugin.py
Expand Up @@ -296,12 +296,15 @@ def do_install(self, url, name, show_install_notes=True):
def do_uninstall(self, name):
"""Uninstall a plugin."""
for plugin in self.site.plugin_manager.getAllPlugins(): # FIXME: this is repeated thrice
p = plugin.path
if os.path.isdir(p):
p = p + os.sep
else:
p = os.path.dirname(p)
if name == plugin.name: # Uninstall this one
p = plugin.path
if os.path.isdir(p):
# Plugins that have a package in them need to delete parent
# Issue #2356
p = p + os.sep
p = os.path.abspath(os.path.join(p, os.pardir))
else:
p = os.path.dirname(p)
LOGGER.warning('About to uninstall plugin: {0}'.format(name))
LOGGER.warning('This will delete {0}'.format(p))
sure = utils.ask_yesno('Are you sure?')
Expand Down

0 comments on commit 296fef7

Please sign in to comment.