Skip to content

Reflex installs Bun even though BUN_PATH is set  #3791

@n0r1z0

Description

@n0r1z0

Describe the bug
Reflex installs Bun even though BUN_PATH is set.

To Reproduce

  1. Install Bun manually. However, the version of Bun is different from constants.Bun.VERSION.
  2. Set an environment variable BUN_PATH as the installed bun path.
  3. Run reflex init.

Expected behavior
The installation of Bun would be skipped.

Additional context
The condition of Bun installation seems incorrect.

Current implementation:

# Skip if bun is already installed.
if os.path.exists(get_config().bun_path) and get_bun_version() == version.parse(
constants.Bun.VERSION
):
console.debug("Skipping bun installation as it is already installed.")
return

I suppose this should be changed as below:

# Skip if bun is already installed.
bun_path = get_config().bun_path
if bun_path != constants.Bun.DEFAULT_PATH or os.path.exists(bun_path) and get_bun_version() == version.parse(
    constants.Bun.VERSION
):
    console.debug("Skipping bun installation as it is already installed.")
    return

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions