applicationsonline / librarian

Librarian - A Framework for Bundlers. Librarian-Chef is at: https://github.com/applicationsonline/librarian-chef.
http://applicationsonline.com/
MIT License
655 stars 71 forks source link

librarian-chef update removes cookbooks not referenced in Cheffile #114

Closed volkanunsal closed 11 years ago

volkanunsal commented 11 years ago

The gist of this is I may have a cookbook I created and haven't uploaded to a repo yet. I may be working on it from the cookbooks directory. In that case, I cannot reference it from the Cheffile, either. I think when librarian encounters a recipe it cannot find on the Cheffile, it should leave it there.

yfeldblum commented 11 years ago

In this case, you want to work on your cookbook in some other directory, usually site-cookbooks. Be sure to add that directory to your knife.rb. Librarian-Chef won't touch that directory.

But if you use Librarian-Chef, you're agreeing to Librarian-Chef's contract: it owns your cookbooks directory, and you can't use it anymore. Librarian-Chef manages it on your behalf. You can change which directory Librarian-Chef owns and manages, though.

tamlyn commented 10 years ago

Yikes! I just lost half a day's work to this. Couldn't there be some kind of warning?

thoward commented 10 years ago

I completely agree that this behaviour is too strict. There should be a warning or confirmation. Librarian chef should know which cookbooks it's managing and which ones are out of scope. I also just lost a cookbook I was working on for quite some time due to running librarian-chef update without remembering it would blow it away. This is an unexpected and frankly irresponsible behaviour. This is not the first time this has happened to me, and even knowing what it will do, and knowing how to configure it correctly, it's easy to forget about when you're moving quickly. This issue should really be reopened.

ryana commented 10 years ago

Hi guys,

I'm new to chef. Thanks for lib-chef, I really appreciate having a package manager like this. My problem is that I just had to recreate my AWS IAM accounts because I lost keys that were not committed yet. I did not realize that lib-chef "owns [my] cookbooks directory, and [I] can't use it anymore". I'm sure there are several RTFMs in here ;) But the thing is, you're copying the bundler/gemfile pattern in the way you define Cheffiles, but bundler doesn't go deleting stuff on you. Even the command for cleaning out extra gems requires the "--force" parameter.

Having "librarian-chef install" delete files without any warning is a design error IMO. Would you accept a PR to add in confirmations before deleting files?