Defend against no pdf build

refactor-builder
Eric Holscher 2014-04-07 19:55:34 +02:00
parent 7cb00f8a67
commit d0dac5b101
1 changed files with 3 additions and 2 deletions

View File

@ -219,6 +219,7 @@ class PdfBuilder(BaseSphinx):
from_globs = glob(os.path.join(self.old_artifact_path, "*.pdf"))
if from_globs:
from_file = from_globs[0]
to_file = os.path.join(self.target, "%s.pdf" % self.version.project.slug)
run('mv -f %s %s' % (from_file, to_file))
if from_file:
to_file = os.path.join(self.target, "%s.pdf" % self.version.project.slug)
run('mv -f %s %s' % (from_file, to_file))