Add frontend flag to _init (#3054)

This commit is contained in:
Nikhil Rao 2024-04-09 13:15:18 -07:00 committed by GitHub
parent d5e3ccaed8
commit dd241a1097
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -856,12 +856,16 @@ def needs_reinit(frontend: bool = True) -> bool:
)
raise typer.Exit(1)
# Don't need to reinit if not running in frontend mode.
if not frontend:
return False
# Make sure the .reflex directory exists.
if not os.path.exists(constants.Reflex.DIR):
return True
# Make sure the .web directory exists in frontend mode.
if frontend and not os.path.exists(constants.Dirs.WEB):
if not os.path.exists(constants.Dirs.WEB):
return True
if constants.IS_WINDOWS: