plushie/binary

Resolve the path to the plushie Rust binary.

Resolution order:

  1. PLUSHIE_BINARY_PATH env var (error if set but file missing)
  2. priv/bin/plushie (installed by gleam run -m plushie/download or gleam run -m plushie/build)
  3. Precompiled at priv/bin/{platform}-{arch}/plushie
  4. Custom build at _build/{env}/plushie/target/release/plushie
  5. Common local paths (./plushie, ../plushie/target/release/plushie)

Returns Result(String, BinaryError) with the path on success.

Types

Error when the plushie binary cannot be found.

pub type BinaryError {
  NotFound(searched: List(String))
  EnvVarPointsToMissing(path: String)
}

Constructors

  • NotFound(searched: List(String))

    Binary not found at any searched path.

  • EnvVarPointsToMissing(path: String)

    PLUSHIE_BINARY_PATH is set but the file doesn’t exist.

Values

pub fn error_to_string(err: BinaryError) -> String

Format a binary error as a human-readable string.

pub fn find() -> Result(String, BinaryError)

Find the plushie binary, searching in priority order.

Search Document