Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: manifest-path must point to a pixi.toml #324

Merged
merged 2 commits into from
Sep 7, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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