-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Add a success message on publish to crates.io
#11977
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -245,6 +245,20 @@ pub fn publish(ws: &Workspace<'_>, opts: &PublishOpts<'_>) -> CargoResult<()> { | |
| } | ||
| } | ||
|
|
||
| // Print success note on publish | ||
| if opts.registry.is_none() { | ||
| if let Some(ref registries) = pkg.publish() { | ||
| if registries[0] == CRATES_IO_REGISTRY { | ||
| if let Ok(packages) = opts.to_publish.get_packages(ws) { | ||
| for package in packages { | ||
| opts.config | ||
| .shell().note(format!("Your crate was successfully published to crates.io! You can visit it at https://crates.io/crates/{} .", package.name()))? | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
Comment on lines
+248
to
+261
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The message you showed I'm assuming is from a stable release. As you saw in the test, See #11713 Adding another success message feels a bit excessive in the amount of output we are showing the user. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah you're right. I guess I just have a weird / old version (I made the issue in February, maybe the stable ver. there has changed a lot?) Anyways, I'm going to close the PR |
||
| Ok(()) | ||
| } | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checking only the first of the potential registries doesn't seem right.
We should instead check what registry we actually published to