瀏覽代碼

Add frontend flag to _init (#3054)

Nikhil Rao 1 年之前
父節點
當前提交
dd241a1097
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      reflex/utils/prerequisites.py

+ 5 - 1
reflex/utils/prerequisites.py

@@ -856,12 +856,16 @@ def needs_reinit(frontend: bool = True) -> bool:
         )
         )
         raise typer.Exit(1)
         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.
     # Make sure the .reflex directory exists.
     if not os.path.exists(constants.Reflex.DIR):
     if not os.path.exists(constants.Reflex.DIR):
         return True
         return True
 
 
     # Make sure the .web directory exists in frontend mode.
     # 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
         return True
 
 
     if constants.IS_WINDOWS:
     if constants.IS_WINDOWS: