Skip to content

Commit

Permalink
fix: handle terminal failure with more grace
Browse files Browse the repository at this point in the history
  • Loading branch information
tmlye committed Feb 25, 2024
1 parent ef83f1a commit f95c897
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/commands/services.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit f95c897

Please sign in to comment.