Create the static directory if it is missing
[cookbook.git] / 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)