#!/usr/bin/env bash # Build a self-contained native Bun executable for the current platform. set -euo pipefail mkdir -p dist # Default to the current platform for local development. Release builders can # select an explicit Bun compile target (for example bun-linux-x64-baseline) # so the artifact does not inherit the build host's CPU feature level. TARGET=${BUN_COMPILE_TARGET:-bun} bun build src/cli/index.ts \ --compile \ --outfile dist/shard \ --target "$TARGET" chmod +x dist/shard echo "built dist/shard ($TARGET executable)"