Added option to disable bun. Useful if bun is not supported on some OS. (#769)

This commit is contained in:
Alek Petuskey 2023-04-03 17:06:30 -07:00 committed by GitHub
parent 13f0182343
commit bcd2df6c09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -47,6 +47,9 @@ class Config(Base):
# The path to the bun executable.
bun_path: str = constants.BUN_PATH
# Disable bun.
disable_bun: bool = False
# Additional frontend packages to install.
frontend_packages: List[str] = []

View File

@ -72,6 +72,8 @@ def get_package_manager() -> str:
Exit: If the app directory is invalid.
"""
config = get_config()
# Check that the node version is valid.
if not check_node_version(constants.MIN_NODE_VERSION):
console.print(
@ -80,7 +82,7 @@ def get_package_manager() -> str:
raise typer.Exit()
# On Windows, we use npm instead of bun.
if platform.system() == "Windows":
if platform.system() == "Windows" or config.disable_bun:
npm_path = path_ops.which("npm")
if npm_path is None:
raise FileNotFoundError("Pynecone requires npm to be installed on Windows.")