mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -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,
|
||||||
|
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!(
|
format!(
|
||||||
"Failed to publish @{}/{} at {}",
|
"Failed to publish @{}/{} at {}",
|
||||||
package.scope, package.package, package.version
|
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