Make output dir if it doesn't exist.

This commit is contained in:
Georg Brandl 2008-11-04 23:46:17 +01:00
parent 7aa1c5eed2
commit 19790f4a0d
2 changed files with 3 additions and 3 deletions

View File

@ -72,8 +72,8 @@ def main(argv=sys.argv):
return 1
outdir = path.abspath(args[1])
if not path.isdir(outdir):
print >>sys.stderr, 'Error: Cannot find output directory.'
return 1
print >>sys.stderr, 'Making output directory...'
os.makedirs(outdir)
except (IndexError, getopt.error):
usage(argv)
return 1

View File

@ -67,7 +67,7 @@ class Builder(object):
self.outdir = app.outdir
self.doctreedir = app.doctreedir
if not path.isdir(self.doctreedir):
os.mkdir(self.doctreedir)
os.makedirs(self.doctreedir)
self.app = app
self.warn = app.warn