Skip to content

Commit

Permalink
fix(deployer): return empty list when when no service is found (#1495)
Browse files Browse the repository at this point in the history
  • Loading branch information
Guga Gongadze authored Jan 5, 2024
1 parent 52ca24a commit 386c9cd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cargo-shuttle/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,12 @@ impl Shuttle {
let table = get_deployments_table(&deployments, proj_name, page, raw, page_hint);

println!("{table}");
println!("Run `cargo shuttle logs <id>` to get logs for a given deployment.");

if deployments.is_empty() {
println!("Run `cargo shuttle deploy` to deploy your project.");
} else {
println!("Run `cargo shuttle logs <id>` to get logs for a given deployment.");
}

Ok(CommandOutcome::Ok)
}
Expand Down
2 changes: 1 addition & 1 deletion deployer/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ pub async fn get_deployments(

Ok(Json(deployments))
} else {
Err(Error::NotFound("service not found".to_string()))
Ok(Json(vec![]))
}
}

Expand Down

0 comments on commit 386c9cd

Please sign in to comment.