-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a confirmation when publishing a non-existing crate on crates.io #883
Comments
This is somewhat of a delicate issue because if we add a confirmation then it's likely that everyone will get into the habit of just hitting enter right past it, defeating the purpose of it in the first place. The alternative to this is to get in the habit of running |
Accidentally publishing a super-top-secret repo came to my mind as well today. It would be nice to be able to add something like Maybe even the other way around: since almost every project will be using cargo to manage dependencies, but people most probably don't want to publish everything, publishing could be disabled by default unless you explicitly turn it on with |
@zargony
|
Related: #2202 (RFC: Add option to mark a crate "private" so it's not publishable to crates.io) |
A common UI-solution is to have the user confirm his intent by re-typing the name of the crate instead of just hitting some please-go-away-message on the head.
|
I would go as far as making |
The |
It's documented here: https://doc.rust-lang.org/cargo/reference/manifest.html#the-publish--field-optional |
@ehuss Ah, thanks! |
Fixed in #2321 fwiw |
Right now, executing
cargo publish
automatically publishes the crate on crates.io without any confirmation.This could lead to "oops, I just wanted to try the command" or "oops, I was in the wrong directory and accidentally published my super-top-secret repo instead of my public project" moments.
The text was updated successfully, but these errors were encountered: