Mercurial > piecrust2
comparison piecrust/commands/builtin/util.py @ 38:091f99bfbe44
Fix running `chef` outside of a website. Slightly better error reporting.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Thu, 21 Aug 2014 10:56:17 -0700 |
parents | afcfecd3bf92 |
children | 4bc166d3a830 |
comparison
equal
deleted
inserted
replaced
37:afcfecd3bf92 | 38:091f99bfbe44 |
---|---|
71 super(PrepareCommand, self).__init__() | 71 super(PrepareCommand, self).__init__() |
72 self.name = 'prepare' | 72 self.name = 'prepare' |
73 self.description = "Prepares new content for your website." | 73 self.description = "Prepares new content for your website." |
74 | 74 |
75 def setupParser(self, parser, app): | 75 def setupParser(self, parser, app): |
76 # Don't setup anything if this is a null app | |
77 # (for when `chef` is run from outside a website) | |
78 if app.root_dir is None: | |
79 return | |
80 | |
76 subparsers = parser.add_subparsers() | 81 subparsers = parser.add_subparsers() |
77 for src in app.sources: | 82 for src in app.sources: |
78 if not isinstance(src, IPreparingSource): | 83 if not isinstance(src, IPreparingSource): |
79 logger.debug("Skipping source '%s' because it's not preparable.") | 84 logger.debug("Skipping source '%s' because it's not preparable.") |
80 continue | 85 continue |