websterclay/knife-github-cookbooks — pull request #15 by sumbach (2011-10-30 22:14:41+00:00)
Title: Ensure cookbooks path exists before merging

Under the following circumstances, the cookbooks path will not exist after the
call to reset_to_default_state. In this instance, the directory should be
created before attempting to merge the new cookbook.

- cookbooks path is an empty subdirectory within an existing git repo (e.g, my_project/cookbooks)
- user attempts to install a cookbook `cd my_project; knife cookbook github install --cookbook-path cookbooks cookbooks/yum`
- knife clones the cookbook from github and commits it to a vendor branch
- upon switching back to the master branch, the (previously empty) cookbooks directory will no longer exist

In this instance, it should be safe to create the previously extant directory so the merge can be completed.