updated prompt_continue, so it now gives the option of either exiting on failure or returning a true/false value

This commit is contained in:
ronnyabraham 2019-11-03 17:44:16 +02:00
parent 39d6514eda
commit 6b3d4be580

View file

@ -379,7 +379,8 @@ def link_create(path_src, path_dst, debug=False):
return msg_debug
def prompt_continue(message="Do you want to continue? Y/n", default="Y"):
def prompt_continue(message="Do you want to continue? Y/n", default="Y",
exit=True):
""" prompts user if he wants to continue
Keyword Arguments:
@ -399,9 +400,13 @@ def prompt_continue(message="Do you want to continue? Y/n", default="Y"):
printvar(
"prompt_val", prompt_val,
not booleanize(prompt_val))
return True
else:
if not booleanize(prompt_val):
sys.exit()
if exit:
sys.exit()
else:
return False
def check_debug(env):