From f95c8975dbc7fe22ba23859278939ddd9ff04fa6 Mon Sep 17 00:00:00 2001 From: Sascha Eglau Date: Sun, 25 Feb 2024 19:35:47 +0100 Subject: [PATCH] fix: handle terminal failure with more grace --- src/commands/services.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/commands/services.rs b/src/commands/services.rs index 78dead8..3ac2334 100644 --- a/src/commands/services.rs +++ b/src/commands/services.rs @@ -159,7 +159,10 @@ impl Deploy { fn render_diff(&self, a: String, b: String) -> Result<()> { let Changeset { diffs, .. } = Changeset::new(&a, &b, "\n"); - let mut t = term::stdout().unwrap(); + let mut t = match term::stdout() { + Some(stdout) => stdout, + None => return Err(anyhow!("Could not render diff. Consider using --no-confirm")) + }; for i in 0..diffs.len() { match diffs[i] { Difference::Same(ref x) => {