changeset 764:f7ddd730c08d

plugins: Abort the command if there's no site.
author Ludovic Chabant <ludovic@chabant.com>
date Sat, 02 Jul 2016 01:16:50 -0700
parents f6a13dba38d6
children 549e21789ad9
files piecrust/commands/builtin/plugins.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/piecrust/commands/builtin/plugins.py	Thu Jun 30 22:39:33 2016 -0700
+++ b/piecrust/commands/builtin/plugins.py	Sat Jul 02 01:16:50 2016 -0700
@@ -30,6 +30,9 @@
         p.set_defaults(sub_func=self._listPlugins)
 
     def checkedRun(self, ctx):
+        if ctx.app.root_dir is None:
+            raise SiteNotFoundError(theme=ctx.app.theme_site)
+
         if not hasattr(ctx.args, 'sub_func'):
             ctx.parser.parse_args(['plugins', '--help'])
             return