#!/usr/bin/env bash # Build albedo-render into priv/bin, where the files plugin looks for it. # Several gates or `gleam test` runs may install at once: cargo serialises the # build, and each run publishes through its own temporary file and an atomic # rename, so a reader never sees a partial binary and installs never collide. set -euo pipefail cd "$(dirname "$0")" cargo build --release --locked mkdir -p ../../priv/bin staged=$(mktemp ../../priv/bin/.albedo-render.XXXXXX) trap 'rm -f "$staged"' EXIT install -m 755 target/release/albedo-render "$staged" mv -f "$staged" ../../priv/bin/albedo-render