Convert logical statement to loop

This commit is contained in:
Ferit Yiğit BALABAN 2023-02-09 14:41:44 +03:00
parent c9546beefa
commit 836d79a731

View File

@ -214,13 +214,15 @@ def main():
if flag_interactive: if flag_interactive:
# if interactive flag was fed, ignore backup and deploy key # if interactive flag was fed, ignore backup and deploy key
# ask user for action (backup or deploy) # ask user for action (backup or deploy)
ans = input('(B)ackup or (D)eploy is possible, select one: ') while True:
if ans.lower() = 'b': ans = input('(B)ackup or (D)eploy is possible, select one: ').lower()
if ans == 'b' or ans == 'd':
break
if ans = 'b':
# interactive backup # interactive backup
elif ans.lower() = 'd': elif ans = 'd':
# interactive deploy # interactive deploy
else:
# ask again
else: else:
# continue according to set flag, XOR # continue according to set flag, XOR
if flag_backup and not flag_deploy: if flag_backup and not flag_deploy: