diff --git a/robyn/__main__.py b/robyn/__main__.py index e10b7f161..b1fa5c572 100644 --- a/robyn/__main__.py +++ b/robyn/__main__.py @@ -1,22 +1,27 @@ import os import webbrowser +from InquirerPy import prompt +from InquirerPy.base.control import Choice from .argument_parser import Config from robyn import __version__ -def check(value, input_name): - while value not in ["Y", "N"]: - print("Invalid input. Please enter Y or N") - value = input(f"Need {input_name}? (Y/N) ") - return value - - def create_robyn_app(): - project_dir = input("Enter the name of the project directory: ") - docker = input("Need Docker? (Y/N) ") - - # Initailize a new Robyn project - docker = check(docker, "Docker") + questions = [ + {"type": "input", "message": "Enter the name of the project directory:"}, + { + "type": "list", + "message": "Need Docker? (Y/N)", + "choices": [ + Choice("Y", name="Y"), + Choice("N", name="N"), + ], + "default": None, + }, + ] + result = prompt(questions=questions) + project_dir = result[0] + docker = result[1] print(f"Creating a new Robyn project '{project_dir}'...")