You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As this time of writing, running librarian-chef with an existing cookbooks directory will wipe out all the data before installing the dependencies. Without letting the user know what's going behind the scene. This is an issue when you're beginner and you start writing recipes and then want to manage dependencies to test them, and everything is in the same cookbooks directory. Like detailed in First steps with Chef tutorial for example.
We should never destroy any data without informing the user before.
A proposed solution would be to explain to the user what's going and prompting him/her for it's agreement, like the following:
A 'cookbook' directory already exists. Proceeding will remove the current
directory and might lead to data loss. Are you sure to continue? (y/N)
When the answer is negative (no/n), the program exits without any further ado.
When the answer is positive (yes/y), the program behaves the same as currently.
We should be protective regarding the user data, hence the capital letter N as default choice. So, even when a user hit [ENTER] without reading the warning message his/her recipes are safe.
For advanced usage, we can also provide a flag to prevent the prompt, like -y/--assumeyes (apt/yum style) or -f/--force (rm style) which will enforce the destructive behavior.
PS: I learned that lesson the hard way and want to prevent anyone to experience this "WTF?!" moment when your data is vacuumed in space.
PPS: I'm not a Rubyist but might be able to land a patch with some help and good pointers.
The text was updated successfully, but these errors were encountered:
As this time of writing, running librarian-chef with an existing cookbooks directory will wipe out all the data before installing the dependencies. Without letting the user know what's going behind the scene. This is an issue when you're beginner and you start writing recipes and then want to manage dependencies to test them, and everything is in the same cookbooks directory. Like detailed in First steps with Chef tutorial for example.
We should never destroy any data without informing the user before.
A proposed solution would be to explain to the user what's going and prompting him/her for it's agreement, like the following:
When the answer is negative (
no/n
), the program exits without any further ado.When the answer is positive (
yes/y
), the program behaves the same as currently.We should be protective regarding the user data, hence the capital letter N as default choice. So, even when a user hit
[ENTER]
without reading the warning message his/her recipes are safe.For advanced usage, we can also provide a flag to prevent the prompt, like
-y/--assumeyes
(apt/yum
style) or-f/--force
(rm
style) which will enforce the destructive behavior.PS: I learned that lesson the hard way and want to prevent anyone to experience this "WTF?!" moment when your data is vacuumed in space.
PPS: I'm not a Rubyist but might be able to land a patch with some help and good pointers.
The text was updated successfully, but these errors were encountered: