Permalink
Browse files

Merge pull request #65 from mheffner/no_metadata.json

Also regenerate if the metadata.json file doesn't exist.
  • Loading branch information...
2 parents 245f8f5 + 99ad3cf commit 135c46398ac78a879908eab324b557c69a1d7511 @tobami tobami committed Oct 20, 2011
Showing with 3 additions and 2 deletions.
  1. +3 −2 littlechef/lib.py
View
@@ -91,8 +91,9 @@ def _generate_metadata(path, cookbook_path, name):
metadata_path_rb = os.path.join(path, 'metadata.rb')
metadata_path_json = os.path.join(path, 'metadata.json')
if (os.path.exists(metadata_path_rb) and
- os.stat(metadata_path_rb).st_mtime > \
- os.stat(metadata_path_json).st_mtime):
+ (not os.path.exists(metadata_path_json) or
+ os.stat(metadata_path_rb).st_mtime > \
+ os.stat(metadata_path_json).st_mtime)):
try:
proc = subprocess.Popen(
['knife', 'cookbook', 'metadata', '-o', cookbook_path, name],

0 comments on commit 135c463

Please sign in to comment.