Add optional argument --name to pc init (#735)

This commit is contained in:
Harish Chandran 2023-03-30 06:58:57 +05:30 committed by GitHub
parent 1fdc01fa56
commit a43a83ad24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,9 +23,9 @@ def version():
@cli.command()
def init():
def init(name: str = typer.Option(None, help="Name of the app to be initialized.")):
"""Initialize a new Pynecone app in the current directory."""
app_name = prerequisites.get_default_app_name()
app_name = prerequisites.get_default_app_name() if name is None else name
# Make sure they don't name the app "pynecone".
if app_name == constants.MODULE_NAME: