workspacer_cli/
check_publish_ready_workspace.rs1crate::ix!();
3
4#[derive(Debug, StructOpt, Getters, Setters)]
8#[getset(get = "pub")]
9pub struct CheckPublishReadyWorkspaceCommand {
10 #[structopt(long = "path")]
12 workspace_path: Option<PathBuf>,
13
14 #[structopt(long = "skip-git-check")]
16 skip_git_check: bool,
17}
18
19impl CheckPublishReadyWorkspaceCommand {
20 #[tracing::instrument(level = "trace", skip(self))]
21 pub async fn run(&self) -> Result<(), WorkspaceError> {
22 run_with_workspace(
24 self.workspace_path().clone(),
25 *self.skip_git_check(),
26 |ws| {
27 Box::pin(async move {
28 ws.ready_for_cargo_publish().await.map_err(|err| {
30 error!("Workspace is NOT ready for publish: {:?}", err);
31 err
32 })?;
33
34 info!("All crates in workspace are READY for publish!");
35 Ok(())
36 })
37 },
38 ).await
39 }
40}