Skip to content

Commit

Permalink
feat: Improved the current --create flag of robyn cli with new style
Browse files Browse the repository at this point in the history
  • Loading branch information
Mr-Sunglasses authored and sansyrox committed Aug 10, 2023
1 parent 8fe2f89 commit 2c452fc
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions robyn/__main__.py
Original file line number Diff line number Diff line change
@@ -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}'...")

Expand Down

0 comments on commit 2c452fc

Please sign in to comment.