Skip to content

Commit

Permalink
Merge pull request #324 from baszalmstra/feat/manifest_path_name
Browse files Browse the repository at this point in the history
feat: manifest-path must point to a pixi.toml
  • Loading branch information
tdejager authored Sep 7, 2023
2 parents 42a6822 + 3f74572 commit 92b06e5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/project/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ pub mod environment;
pub mod manifest;
mod serde;

use crate::consts;
use crate::consts::{self, PROJECT_MANIFEST};
use crate::project::manifest::{ProjectManifest, TargetMetadata, TargetSelector};
use crate::task::{CmdArgs, Task};
use indexmap::IndexMap;
Expand All @@ -12,6 +12,7 @@ use rattler_conda_types::{
};
use rattler_virtual_packages::VirtualPackage;
use std::collections::{HashMap, HashSet};
use std::ffi::OsStr;
use std::{
env, fs,
path::{Path, PathBuf},
Expand Down Expand Up @@ -105,6 +106,10 @@ impl Project {
pub fn load(filename: &Path) -> miette::Result<Self> {
// Determine the parent directory of the manifest file
let full_path = dunce::canonicalize(filename).into_diagnostic()?;
if full_path.file_name().and_then(OsStr::to_str) != Some(PROJECT_MANIFEST) {
miette::bail!("the manifest-path must point to a {PROJECT_MANIFEST} file");
}

let root = full_path
.parent()
.ok_or_else(|| miette::miette!("can not find parent of {}", filename.display()))?;
Expand Down

0 comments on commit 92b06e5

Please sign in to comment.