1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

fix: don't error if a version already published (#21455)

This commit is contained in:
Luca Casonato 2023-12-04 12:40:58 +01:00 committed by GitHub
parent 0a738dc49d
commit 7d5ddc462c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -388,14 +388,28 @@ async fn perform_publish(
.send() .send()
.await?; .await?;
let mut task = parse_response::<PublishingTask>(response) let res = parse_response::<PublishingTask>(response).await;
.await let mut task = match res {
.with_context(|| { Ok(task) => task,
format!( Err(err) if err.code == "versionAlreadyExists" => {
"Failed to publish @{}/{} at {}", println!(
package.scope, package.package, package.version "{} @{}/{}@{}",
) colors::yellow("Skipping, already published"),
})?; package.scope,
package.package,
package.version
);
continue;
}
Err(err) => {
return Err(err).with_context(|| {
format!(
"Failed to publish @{}/{} at {}",
package.scope, package.package, package.version
)
})
}
};
let interval = std::time::Duration::from_secs(2); let interval = std::time::Duration::from_secs(2);
while task.status != "success" && task.status != "failure" { while task.status != "success" && task.status != "failure" {