perform the processor prebuild check first

it is smarter to perform the non-destructive check first, rather than blowing
away the output directory and then reporting that it is impossible to rebuild
the document output tree
This commit is contained in:
Martin A. Brown 2016-02-27 11:13:58 -08:00
parent fe520cd583
commit 36e92b83d9
1 changed files with 9 additions and 7 deletions

View File

@ -154,19 +154,21 @@ class BaseDoctype(object):
# -- the output directory gets to prepare; must return True
#
if not self.output.hook_prebuild():
return False
opwd = os.getcwd()
os.chdir(self.output.dirname)
# -- the processor gets to prepare; must return True
#
if not self.build_precheck():
logger.warning("%s %s failed (%s), skipping to next build",
'build_precheck', stem, classname)
stem, 'build_precheck', classname)
return False
if not self.output.hook_prebuild():
logger.warning("%s %s failed (%s), skipping to next build",
stem, 'hook_prebuild', classname)
return False
opwd = os.getcwd()
os.chdir(self.output.dirname)
# -- now, we can try to build everything; this is the BIG WORK!
#
result = self.buildall()