File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 11__author__ = "desultory"
2- __version__ = "7.0 .0"
2+ __version__ = "7.1 .0"
33
44from pathlib import Path
55from shutil import which
@@ -252,6 +252,8 @@ def prompt_user(self) -> list[str]:
252252 The first argument is the prompt message.
253253 The second argument is the timeout in seconds.
254254
255+ If the timeout is not set, or set to zero, loops wait_for_space until space is pressed.
256+
255257 if plymouth is running, run 'plymouth display-message --text="$prompt" instead of echo.
256258 """
257259 output = ['prompt=${1:-"Press space to continue."}' ]
@@ -266,6 +268,12 @@ def prompt_user(self) -> list[str]:
266268 else :
267269 output += [r'printf "\033[1;35m *\033[0m %s\n" "$prompt"' ]
268270 output += [
271+ """if [ -z "$2" ] || [ "$(echo "$2 > 0" | bc)" -eq 0 ]; then""" ,
272+ ' while ! wait_for_space; do' ,
273+ ' ewarn "Invalid input, press space to continue."' ,
274+ ' done' ,
275+ ' return 0' ,
276+ 'fi' ,
269277 'wait_for_space "$2"' ,
270278 'return "$?"' ,
271279 ]
You can’t perform that action at this time.
0 commit comments