mirror of https://github.com/tLDP/python-tldp
docbooksgml needs to know about --script mode
This commit is contained in:
parent
ca8b8e211f
commit
62c9cef32f
|
@ -117,11 +117,14 @@ class DocbookSGML(BaseDoctype, SignatureChecker):
|
|||
def cleaned_indexsgml(self):
|
||||
'''clean the junk from the output dir after building the index.sgml'''
|
||||
# -- be super cautious before removing a bunch of files
|
||||
cwd = os.getcwd()
|
||||
if not os.path.samefile(cwd, self.output.dirname):
|
||||
logger.error("%s (cowardly) refusing to clean directory %s", cwd)
|
||||
logger.error("%s expected to find %s", self.output.dirname)
|
||||
return False
|
||||
if not self.config.script:
|
||||
cwd = os.getcwd()
|
||||
if not os.path.samefile(cwd, self.output.dirname):
|
||||
logger.error("%s (cowardly) refusing to clean directory %s",
|
||||
self.source.stem, cwd)
|
||||
logger.error("%s expected to find %s",
|
||||
self.source.stem, self.output.dirname)
|
||||
return False
|
||||
s = '''find . -mindepth 1 -maxdepth 1 -not -type d -delete -print'''
|
||||
return self.shellscript(s)
|
||||
|
||||
|
|
Loading…
Reference in New Issue