Display promt in try properly

This commit is contained in:
oddlama 2020-01-04 13:31:39 +01:00
parent 97fd3e77ea
commit 0c3ca37792
No known key found for this signature in database
GPG Key ID: 88EA325D51D53908
1 changed files with 3 additions and 2 deletions

View File

@ -83,10 +83,11 @@ try() {
if [[ "$cmd_status" != 0 ]]; then
echo_console " * Command failed: \$ $*"
echo_console -n "Last command failed (code $cmd_status), specify next action $prompt_parens "
echo_console "Last command failed with exit code $cmd_status"
# Prompt until input is valid
while true; do
echo_console -n "Specify next action $prompt_parens "
flush_stdin
read -r response \
|| die "Error in read"
@ -100,7 +101,7 @@ try() {
a|abort) die "Installation aborted" ;;
c|continue) return 0 ;;
p|print) echo_console "\$ $*" ;;
*) echo_console -n "Response not understood $prompt_parens " ;;
*) ;;
esac
done
fi