Skip to content

Commit 672ee04

Browse files
committed
Avoid overwriting what is already in the registry
1 parent 53b14ee commit 672ee04

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

xtask/src/commands/relcheck.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,19 @@ fn update(args: UpdateArgs) -> Result<()> {
265265
for package in sorted.iter() {
266266
log::info!("Package = {}", package);
267267

268+
let toml = package.toml();
269+
let version = toml.version();
270+
271+
if std::fs::exists(format!(
272+
"target/local-registry/{}-{}.crate",
273+
package, version
274+
))? {
275+
log::warn!("Already exists as version {version}");
276+
continue;
277+
}
278+
core::mem::drop(toml);
279+
log::info!("Updating...");
280+
268281
// make sure we have a lock file
269282
std::process::Command::new("cargo")
270283
.arg("update")

0 commit comments

Comments
 (0)