workspacer_cli/
cleanup_workspace.rs1crate::ix!();
3
4#[derive(Debug, StructOpt, Getters, Setters)]
6#[getset(get="pub")]
7pub struct CleanupWorkspaceCommand {
8 #[structopt(long = "path")]
10 workspace_path: Option<PathBuf>,
11
12 #[structopt(long = "skip-git-check")]
14 skip_git_check: bool,
15}
16
17impl CleanupWorkspaceCommand {
18 pub async fn run(&self) -> Result<(), WorkspaceError> {
19 run_with_workspace(
21 self.workspace_path().clone(),
22 *self.skip_git_check(),
23 move |ws| {
24 Box::pin(async move {
25 ws.cleanup_workspace().await?;
27 info!("Workspace successfully cleaned up (removed top-level target/, Cargo.lock, etc.)");
28 Ok(())
29 })
30 }
31 ).await
32 }
33}