Skip to content

Commit

Permalink
fix: parse env name on adding
Browse files Browse the repository at this point in the history
  • Loading branch information
ruben-arts committed Oct 15, 2024
1 parent 7dd06d3 commit af2bc1f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/cli/project/environment/add.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use crate::Project;
use clap::Parser;
use pixi_manifest::EnvironmentName;
use std::str::FromStr;

#[derive(Parser, Debug)]
pub struct Args {
Expand All @@ -26,7 +27,7 @@ pub struct Args {

pub async fn execute(mut project: Project, args: Args) -> miette::Result<()> {
let environment_exists = project
.environment(&EnvironmentName::Named(args.name.clone()))
.environment(&EnvironmentName::from_str(args.name.as_str())?)
.is_some();
if environment_exists && !args.force {
return Err(miette::miette!(
Expand Down

0 comments on commit af2bc1f

Please sign in to comment.