Explorar o código

Fix windows symlink bug (#248)

Elijah Ahianyo %!s(int64=2) %!d(string=hai) anos
pai
achega
897ef161bf
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      pynecone/utils.py

+ 9 - 1
pynecone/utils.py

@@ -499,7 +499,15 @@ def setup_frontend():
     install_frontend_packages()
     install_frontend_packages()
 
 
     # Link the assets folder.
     # Link the assets folder.
-    ln(src=os.path.join("..", constants.APP_ASSETS_DIR), dest=constants.WEB_ASSETS_DIR)
+    if platform.system() == "Windows":
+        # copy asset files to public folder
+        mkdir(constants.WEB_ASSETS_DIR)
+        cp(src=constants.APP_ASSETS_DIR, dest=constants.WEB_ASSETS_DIR)
+    else:
+        ln(
+            src=os.path.join("..", constants.APP_ASSETS_DIR),
+            dest=constants.WEB_ASSETS_DIR,
+        )
 
 
 
 
 def run_frontend(app: App):
 def run_frontend(app: App):