feat: plans in workspace now works
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
use std::{collections::BTreeMap, fmt::Debug, path::PathBuf};
|
||||
|
||||
use colored_json::Paint;
|
||||
use kdl::{KdlDocument, KdlNode, KdlValue};
|
||||
use serde::Serialize;
|
||||
|
||||
@@ -57,6 +56,7 @@ impl TryFrom<KdlDocument> for Plan {
|
||||
pub enum ProjectPlan {
|
||||
Local { path: PathBuf },
|
||||
Git { url: String, path: Option<PathBuf> },
|
||||
Workspace { name: String },
|
||||
NoPlan,
|
||||
}
|
||||
|
||||
@@ -96,6 +96,17 @@ impl TryFrom<&KdlNode> for ProjectPlan {
|
||||
});
|
||||
}
|
||||
|
||||
if let Some(workspace) = children.get_arg("workspace") {
|
||||
return Ok(Self::Workspace {
|
||||
name: workspace
|
||||
.as_string()
|
||||
.map(|w| w.to_string())
|
||||
.ok_or(anyhow::anyhow!(
|
||||
"workspace requires a project name in the same project"
|
||||
))?,
|
||||
});
|
||||
}
|
||||
|
||||
Ok(Self::NoPlan)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user