Skip to content

Commit b1676ab

Browse files
authored
cli: Flush stdout after printing the database tree (#3888)
`spacetime delete` may print the database tree and ask for confirmation. We did not flush stdout, causing the tree to be interleaved with the yes/no prompt. # Expected complexity level and risk 1
1 parent cc2ac54 commit b1676ab

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

crates/cli/src/subcommands/delete.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,12 @@ async fn send_request(
7373
}
7474

7575
async fn print_database_tree_info(tree: &DatabaseTree) -> io::Result<()> {
76-
tokio::io::stdout()
77-
.write_all(as_termtree(tree).to_string().as_bytes())
78-
.await
76+
let mut stdout = tokio::io::stdout();
77+
stdout.write_all(as_termtree(tree).to_string().as_bytes()).await?;
78+
stdout.write_u8(b'\n').await?;
79+
stdout.flush().await?;
80+
81+
Ok(())
7982
}
8083

8184
fn as_termtree(tree: &DatabaseTree) -> termtree::Tree<String> {

0 commit comments

Comments
 (0)