Skip to content

Commit

Permalink
make status better and show just linked service
Browse files Browse the repository at this point in the history
  • Loading branch information
Milo123459 committed Oct 25, 2023
1 parent 975a01d commit 478fc65
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/commands/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,16 @@ pub async fn command(_args: Args, json: bool) -> Result<()> {
println!("{}", format!("{:?}", plugin.name).dimmed().bold());
}
}
if !project.services.edges.is_empty() {
println!("Services:");
for service in project.services.edges.iter().map(|service| &service.node) {
println!("{}", service.name.dimmed().bold());
}
if let Some(linked_service) = linked_project.service {
let service = project
.services
.edges
.iter()
.find(|service| service.node.id == linked_service)
.expect("service linked doesn't exist");
println!("Service: {}", service.node.name.green().bold());
} else {
println!("Service: {}", "None".red().bold())
}
} else {
println!("{}", serde_json::to_string_pretty(&project)?);
Expand Down

0 comments on commit 478fc65

Please sign in to comment.