mirror of
https://github.com/denoland/deno.git
synced 2024-11-28 16:20:57 -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()
|
.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" {
|
||||||
|
|
Loading…
Reference in a new issue