Skip to content

Programmatic way to locate web bundle path #649

@musjj

Description

@musjj

What problem does this solve or what need does it fill?

In the CI, I often want to know the exact location of the path to the web bundle built by bevy build web --bundle. But the tool currently offers no such option.

What solution would you like?

A machine-friendly, programmatic option to get the location of the web bundle.

Maybe something like:

$ bevy build web --bundle --output-bundle-path
/home/runner/target/bevy_web/web/bevy_new_2d

Additional stdout should be automatically suppressed when --output-bundle-path is present.

What alternative(s) have you considered?

Currently, you need to parse the CLI output which is error-prone and probably unstable:

bevy build web --bundle | ansi2txt | grep -oP "(?<=^info: created bundle at file://).*"

The bevy CLI also currently does not disable color output in pipes, hence the need for ansi2txt.

Additional context

cargo offers the --message-format=json option, which allows you to easily probe paths to any executable artifacts created during the build process.

But this obviously does not work for bevy build web --bundle, because it does its own thing for the bundling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-WebBuilding or running Bevy apps targeting the browserC-FeatureMake something new possible

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions