From: W. Trevor King Date: Fri, 23 Jul 2010 11:45:48 +0000 (-0400) Subject: Create the static directory if it is missing X-Git-Tag: v0.1~6 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8bf3418fd5f4811835a72c2edb395dea8799851b;p=cookbook.git Create the static directory if it is missing Since we don't have any files in it at the moment, and Git doesn't track empty directories. --- diff --git a/bin/cook.py b/bin/cook.py index 42fc032..bd02860 100755 --- a/bin/cook.py +++ b/bin/cook.py @@ -19,6 +19,7 @@ from __future__ import with_statement +import os import os.path import uuid @@ -84,6 +85,8 @@ if __name__ == '__main__': sys.stderr.write('Serving cookbook\n') module_dir = os.path.dirname(os.path.abspath(cookbook.__file__)) static_dir = os.path.join(module_dir, 'static') + if not os.path.exists(static_dir): + os.mkdir(static_dir) template_dir = os.path.join(module_dir, 'template') config = os.path.join(module_dir, 'config') s = Server(c, template_dir)