Create the static directory if it is missing
authorW. Trevor King <wking@drexel.edu>
Fri, 23 Jul 2010 11:45:48 +0000 (07:45 -0400)
committerW. Trevor King <wking@drexel.edu>
Fri, 23 Jul 2010 11:45:54 +0000 (07:45 -0400)
Since we don't have any files in it at the moment, and Git doesn't
track empty directories.

bin/cook.py

index 42fc032b40c9e4431fff2649d73f3840f6352cbc..bd0286059fc133431a4a573f2001967427861200 100755 (executable)
@@ -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)