Mercurial > piecrust2
diff piecrust/commands/builtin/plugins.py @ 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 | 9ae23409d6e9 |
children | 3900169ac81b |
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