cargo publish should default to alt registry if defined in Cargo.toml #8036
Labels
A-registries
Area: registries
C-feature-request
Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Command-publish
When working with multiple Rust projects, some private and some public, it can be frustrating to remember where each package needs to be published. Currently,
cargo publish
defaults to crates.io. This is a great default for public packages that will be used across the community. However, many companies want to use private Rust packages for writing internal tools/libraries.Currently, Cargo.toml supports the
lib.publish
field to limit publishing to one or more registries. This prevents cargo from publishing private packages to crates.io, which is a great feature. I propose a slight augmentation tocargo publish
's default behavior. IfCargo.toml
'slib.publish
field contains a single registry, thencargo publish
should default to publishing to this registry. This makes the default publish commandcargo publish
for every package, no matter where it's being published to.The "single value" limitation could also be lifted, and
cargo publish
could publish to every registry defined in thelib.publish
field, but that seems like more of a surprise than this.The text was updated successfully, but these errors were encountered: