From 137346307248bc9e327847e549c3d6c24b3b11f3 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Sat, 17 Aug 2024 00:14:10 +0200 Subject: add external cargo --- src/cargo/external.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/cargo/external.rs (limited to 'src/cargo/external.rs') diff --git a/src/cargo/external.rs b/src/cargo/external.rs new file mode 100644 index 0000000..c956b68 --- /dev/null +++ b/src/cargo/external.rs @@ -0,0 +1,19 @@ +use std::{path::Path, process::Command}; + +use crate::cli::Args; + +pub fn clean_ext(path: &Path, cli: &Args) { + let mut args = vec!["clean", "--manifest-path", path.to_str().unwrap()]; + if cli.dry_run { + args.push("--dry-run"); + } + if cli.doc { + args.push("--doc"); + } + Command::new("cargo") + .args(args) + .spawn() + .unwrap() + .wait_with_output() + .unwrap(); +} -- cgit v1.2.3