浏览代码

fix: check bun installation exit code during reflex init (#1385)

Siddhant Goel 1 年之前
父节点
当前提交
6f5ac6ace2
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      reflex/utils/prerequisites.py

+ 5 - 1
reflex/utils/prerequisites.py

@@ -281,6 +281,7 @@ def install_bun():
 
 
     Raises:
     Raises:
         FileNotFoundError: if unzip or curl packages are not found.
         FileNotFoundError: if unzip or curl packages are not found.
+        Exit: if installation failed
     """
     """
     # Bun is not supported on Windows.
     # Bun is not supported on Windows.
     if platform.system() == "Windows":
     if platform.system() == "Windows":
@@ -301,7 +302,10 @@ def install_bun():
         if unzip_path is None:
         if unzip_path is None:
             raise FileNotFoundError("Reflex requires unzip to be installed.")
             raise FileNotFoundError("Reflex requires unzip to be installed.")
 
 
-        os.system(constants.INSTALL_BUN)
+        result = subprocess.run(constants.INSTALL_BUN, shell=True)
+
+        if result.returncode != 0:
+            raise typer.Exit(code=result.returncode)
 
 
 
 
 def install_frontend_packages(web_dir: str):
 def install_frontend_packages(web_dir: str):