summaryrefslogblamecommitdiff
path: root/src/cargo/internal.rs
blob: b3e44e4b2cfbdf10b26992a49a65e19f1d0ed402 (plain) (tree)



























                                                              
use std::path::Path;

use cargo::{
    core::Workspace,
    ops::{clean, CleanOptions},
    util::{context::GlobalContext, interning::InternedString},
    CargoResult,
};

use crate::cli::Args;

pub fn clean_int(path: &Path, cli: &Args) -> CargoResult<()> {
    let gctx = GlobalContext::default()?;

    let workspace = Workspace::new(path, &gctx)?;

    let opts = CleanOptions {
        gctx: &gctx,
        spec: vec![],
        targets: vec![],
        profile_specified: false,
        requested_profile: InternedString::new("dev"),
        doc: cli.doc,
        dry_run: cli.dry_run,
    };

    clean(&workspace, &opts)
}