Fix bun issue on Windows (#881)

* Fix bun issue on Windows

* Fix check
This commit is contained in:
Nikhil Rao 2023-04-26 08:26:02 -07:00 committed by GitHub
parent 15485f0716
commit 24c08d6ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -211,8 +211,8 @@ def install_bun():
"""Install bun onto the user's system. """Install bun onto the user's system.
Raises: Raises:
Exit: If the bun version is not supported.
FileNotFoundError: If the required packages are not installed. FileNotFoundError: If the required packages are not installed.
Exit: If the bun version is not supported.
""" """
bun_version = get_bun_version() bun_version = get_bun_version()
if bun_version is not None and bun_version in constants.INVALID_BUN_VERSIONS: if bun_version is not None and bun_version in constants.INVALID_BUN_VERSIONS:
@ -220,8 +220,8 @@ def install_bun():
f"""[red]Bun version {bun_version} is not supported by Pynecone. Please change your to bun version to be between {constants.MIN_BUN_VERSION} and {constants.MAX_BUN_VERSION}.""" f"""[red]Bun version {bun_version} is not supported by Pynecone. Please change your to bun version to be between {constants.MIN_BUN_VERSION} and {constants.MAX_BUN_VERSION}."""
) )
console.print( console.print(
f"""[red]Upgrade by running the following command:[/red] f"""[red]Upgrade by running the following command:[/red]
curl -fsSL https://bun.sh/install | bash -s -- bun-v{constants.MAX_BUN_VERSION} curl -fsSL https://bun.sh/install | bash -s -- bun-v{constants.MAX_BUN_VERSION}
""" """
@ -231,7 +231,7 @@ curl -fsSL https://bun.sh/install | bash -s -- bun-v{constants.MAX_BUN_VERSION}
# Bun is not supported on Windows. # Bun is not supported on Windows.
if platform.system() == "Windows": if platform.system() == "Windows":
console.log("Skipping bun installation on Windows.") console.log("Skipping bun installation on Windows.")
raise typer.Exit() return
# Only install if bun is not already installed. # Only install if bun is not already installed.
if not os.path.exists(get_package_manager()): if not os.path.exists(get_package_manager()):