Skip to content

Commit

Permalink
fix: do proper sanity check on add and run (#3054)
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-arts authored Feb 3, 2025
1 parent 6473aed commit 3f26136
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/cli/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ use pixi_spec::{GitSpec, SourceSpec};
use rattler_conda_types::{MatchSpec, PackageName};

use super::has_specs::HasSpecs;
use crate::environment::sanity_check_project;
use crate::{
cli::cli_config::{DependencyConfig, PrefixUpdateConfig, ProjectConfig},
environment::verify_prefix_location_unchanged,
project::{DependencyType, Project},
};

Expand Down Expand Up @@ -92,8 +92,7 @@ pub async fn execute(args: Args) -> miette::Result<()> {
let mut project = Project::load_or_else_discover(project_config.manifest_path.as_deref())?
.with_cli_config(prefix_update_config.config.clone());

// Sanity check of prefix location
verify_prefix_location_unchanged(project.default_environment().dir().as_path()).await?;
sanity_check_project(&project).await?;

// Add the platform if it is not already present
project
Expand Down
4 changes: 2 additions & 2 deletions src/cli/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use std::sync::Arc;
use std::{collections::HashMap, string::String};

use crate::cli::cli_config::{PrefixUpdateConfig, ProjectConfig};
use crate::environment::verify_prefix_location_unchanged;
use crate::environment::sanity_check_project;
use crate::lock_file::UpdateLockFileOptions;
use crate::project::errors::UnsupportedPlatformError;
use crate::project::virtual_packages::verify_current_platform_has_required_virtual_packages;
Expand Down Expand Up @@ -100,7 +100,7 @@ pub async fn execute(args: Args) -> miette::Result<()> {
}

// Sanity check of prefix location
verify_prefix_location_unchanged(project.default_environment().dir().as_path()).await?;
sanity_check_project(&project).await?;

let best_platform = environment.best_platform();

Expand Down

0 comments on commit 3f26136

Please sign in to comment.