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. build/plushie/bin/plushie-{platform}-{arch} (downloaded binary)
  3. build/plushie/bin/plushie (platform-generic fallback)
  4. priv/bin/plushie-{platform}-{arch} (legacy location, backward compat)
  5. priv/bin/plushie (legacy location, backward compat)
  6. Custom build at _build/{env}/plushie-renderer/target/release/plushie-renderer
  7. Common local paths (./plushie, ../plushie-renderer/target/release/plushie-renderer)

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 download_dir() -> String

Returns the directory where downloaded binaries are stored. Shared across environments (the binary is platform-specific, not env-specific).

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