Skip to content

Commit c2a8ca1

Browse files
committed
cargo_clean: add profile name validation
1 parent 4c272da commit c2a8ca1

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/cargo/ops/cargo_clean.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ pub fn clean(ws: &Workspace<'_>, opts: &CleanOptions<'_>) -> CargoResult<()> {
4242
let (packages, resolve) = ops::resolve_ws(ws)?;
4343
let profiles = ws.profiles();
4444

45+
// Check for whether the profile is defined.
46+
let _ = profiles.base_profile(&opts.profile_kind)?;
47+
4548
// If the release option is set, we set target to release directory
4649
if opts.release {
4750
target_dir = target_dir.join(profiles.get_dir_name(&ProfileKind::Release));

0 commit comments

Comments
 (0)