Skip to content

Commit

Permalink
🚧 data: abort on purely broken profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
vnepogodin committed Aug 11, 2024
1 parent 4a78c64 commit 4b34519
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/data.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ fn fill_profiles(
if !Path::new(&config_file_path).exists() {
continue;
}
if let Ok(profiles) = crate::profile::parse_profiles(&config_file_path) {
for profile in profiles.into_iter() {
if profile.packages.is_empty() {
continue;
}
// if we dont target ai sdk,
// skip profile marked as ai sdk.
if !is_ai_sdk && profile.is_ai_sdk {
continue;
}
// if we target ai sdk,
// skip profile which isn't marked as ai sdk.
if is_ai_sdk && !profile.is_ai_sdk {
continue;
}
configs.push(profile);
let profiles = crate::profile::parse_profiles(&config_file_path)
.expect("Urgent invalid profiles detected!");
for profile in profiles.into_iter() {
if profile.packages.is_empty() {
continue;
}
// if we dont target ai sdk,
// skip profile marked as ai sdk.
if !is_ai_sdk && profile.is_ai_sdk {
continue;
}
// if we target ai sdk,
// skip profile which isn't marked as ai sdk.
if is_ai_sdk && !profile.is_ai_sdk {
continue;
}
configs.push(profile);
}
if let Ok(mut invalid_profile_names) =
crate::profile::get_invalid_profiles(&config_file_path)
Expand Down

0 comments on commit 4b34519

Please sign in to comment.