Added option to disable bun. Useful if bun is not supported on some OS. (#769)
This commit is contained in:
parent
13f0182343
commit
bcd2df6c09
@ -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] = []
|
||||
|
||||
|
@ -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.")
|
||||
|
Loading…
Reference in New Issue
Block a user