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:
parent
0a738dc49d
commit
7d5ddc462c
1 changed files with 22 additions and 8 deletions
|
@ -388,14 +388,28 @@ async fn perform_publish(
|
|||
.send()
|
||||
.await?;
|
||||
|
||||
let mut task = parse_response::<PublishingTask>(response)
|
||||
.await
|
||||
.with_context(|| {
|
||||
let res = parse_response::<PublishingTask>(response).await;
|
||||
let mut task = match res {
|
||||
Ok(task) => task,
|
||||
Err(err) if err.code == "versionAlreadyExists" => {
|
||||
println!(
|
||||
"{} @{}/{}@{}",
|
||||
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);
|
||||
while task.status != "success" && task.status != "failure" {
|
||||
|
|
Loading…
Reference in a new issue