crate::ix!();
#[derive(Debug, StructOpt, Getters, Setters)]
#[getset(get="pub")]
pub struct CleanupWorkspaceCommand {
#[structopt(long = "path")]
workspace_path: Option<PathBuf>,
#[structopt(long = "skip-git-check")]
skip_git_check: bool,
}
impl CleanupWorkspaceCommand {
pub async fn run(&self) -> Result<(), WorkspaceError> {
run_with_workspace(
self.workspace_path().clone(),
*self.skip_git_check(),
move |ws| {
Box::pin(async move {
ws.cleanup_workspace().await?;
info!("Workspace successfully cleaned up (removed top-level target/, Cargo.lock, etc.)");
Ok(())
})
}
).await
}
}