xtask: Skip 10sec delay after publishing macro crate was skipped
(because it already existed)
This commit is contained in:
parent
cae9a3e089
commit
96758df5dd
@ -77,10 +77,14 @@ impl ReleaseTask {
|
|||||||
if let Some(macros) = self.macros() {
|
if let Some(macros) = self.macros() {
|
||||||
print!("Found macros crate. ");
|
print!("Found macros crate. ");
|
||||||
let _dir = pushd(¯os.path)?;
|
let _dir = pushd(¯os.path)?;
|
||||||
macros.publish(&self.http_client)?;
|
let published = macros.publish(&self.http_client)?;
|
||||||
|
|
||||||
println!("Waiting 10 seconds for the release to make it into the crates.io index…");
|
if published {
|
||||||
sleep(Duration::from_secs(10));
|
// Crate was published, instead of publishing skipped (because release already
|
||||||
|
// existed).
|
||||||
|
println!("Waiting 10 seconds for the release to make it into the crates.io index…");
|
||||||
|
sleep(Duration::from_secs(10));
|
||||||
|
}
|
||||||
|
|
||||||
println!("Resuming release of {}…", self.title());
|
println!("Resuming release of {}…", self.title());
|
||||||
}
|
}
|
||||||
@ -246,16 +250,17 @@ impl LocalCrate {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Publish this package on crates.io.
|
/// Publish this package on crates.io.
|
||||||
fn publish(&self, client: &HttpClient) -> Result<()> {
|
fn publish(&self, client: &HttpClient) -> Result<bool> {
|
||||||
println!("Publishing {} {} on crates.io…", self.name, self.version);
|
println!("Publishing {} {} on crates.io…", self.name, self.version);
|
||||||
if self.is_published(client)? {
|
if self.is_published(client)? {
|
||||||
if ask_yes_no("This version is already published. Skip this step and continue?")? {
|
if ask_yes_no("This version is already published. Skip this step and continue?")? {
|
||||||
Ok(())
|
Ok(false)
|
||||||
} else {
|
} else {
|
||||||
Err("Release interrupted by user.".into())
|
Err("Release interrupted by user.".into())
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Ok(cmd!("cargo publish").run()?)
|
cmd!("cargo publish").run()?;
|
||||||
|
Ok(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user