diff options
author | fxqnlr <[email protected]> | 2024-08-17 00:14:10 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2024-08-17 00:14:10 +0200 |
commit | 137346307248bc9e327847e549c3d6c24b3b11f3 (patch) | |
tree | 94d73000aa881c912f93eccbfb9e0d0a7c5857ea /src/cargo/external.rs | |
parent | 371a77a994aeb0beae53f24a0edbf99d70133c33 (diff) | |
download | rsrclean-137346307248bc9e327847e549c3d6c24b3b11f3.tar rsrclean-137346307248bc9e327847e549c3d6c24b3b11f3.tar.gz rsrclean-137346307248bc9e327847e549c3d6c24b3b11f3.zip |
Diffstat (limited to 'src/cargo/external.rs')
-rw-r--r-- | src/cargo/external.rs | 19 |
1 files changed, 19 insertions, 0 deletions
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 @@ | |||
1 | use std::{path::Path, process::Command}; | ||
2 | |||
3 | use crate::cli::Args; | ||
4 | |||
5 | pub fn clean_ext(path: &Path, cli: &Args) { | ||
6 | let mut args = vec!["clean", "--manifest-path", path.to_str().unwrap()]; | ||
7 | if cli.dry_run { | ||
8 | args.push("--dry-run"); | ||
9 | } | ||
10 | if cli.doc { | ||
11 | args.push("--doc"); | ||
12 | } | ||
13 | Command::new("cargo") | ||
14 | .args(args) | ||
15 | .spawn() | ||
16 | .unwrap() | ||
17 | .wait_with_output() | ||
18 | .unwrap(); | ||
19 | } | ||