Commit f8fcb7a
authored
Improve error message when showing prompt in non-interactive shell (#235)
# Objective
Closes #212.
We are showing interactive prompts before we install any required
tooling.
In non-interactive shells (e.g. CI), this will fail with an error.
We should improve this error message to guide the user towards the
`--yes` flag, which confirms the prompts automatically.
# Solution
Use `anyhow`'s `.context(...)` to make the error message more useful,
guiding the user towards `--yes`.
# Testing
Tested in one of [testing repositories in
CI](https://github.com/TimJentzsch/bevy_complex_repo/actions/runs/12867761889/job/35873080585?pr=1#step:6:9).
New output:
```txt
Error: failed to show interactive prompt, try using `--yes` to confirm automatically
Caused by:
0: IO error: not a terminal
1: not a terminal
Error: Process completed with exit code 1.
```1 parent 10d0dbc commit f8fcb7a
2 files changed
+10
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
67 | | - | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
33 | 34 | | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| |||
0 commit comments