Mercurial > piecrust2
comparison 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 |
comparison
equal
deleted
inserted
replaced
763:f6a13dba38d6 | 764:f7ddd730c08d |
---|---|
28 "current environment. The installed one will have an " | 28 "current environment. The installed one will have an " |
29 "asterix (*).")) | 29 "asterix (*).")) |
30 p.set_defaults(sub_func=self._listPlugins) | 30 p.set_defaults(sub_func=self._listPlugins) |
31 | 31 |
32 def checkedRun(self, ctx): | 32 def checkedRun(self, ctx): |
33 if ctx.app.root_dir is None: | |
34 raise SiteNotFoundError(theme=ctx.app.theme_site) | |
35 | |
33 if not hasattr(ctx.args, 'sub_func'): | 36 if not hasattr(ctx.args, 'sub_func'): |
34 ctx.parser.parse_args(['plugins', '--help']) | 37 ctx.parser.parse_args(['plugins', '--help']) |
35 return | 38 return |
36 ctx.args.sub_func(ctx) | 39 ctx.args.sub_func(ctx) |
37 | 40 |