Files
2026-05-29 17:38:47 +08:00

21 lines
632 B
Bash
Executable File

#!/usr/bin/env sh
set -eu
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
ROOT_DIR=$(CDPATH= cd -- "$SCRIPT_DIR/.." && pwd)
if [ -n "${BUN_BIN:-}" ] && [ -x "${BUN_BIN:-}" ]; then
BUN="$BUN_BIN"
elif command -v bun >/dev/null 2>&1; then
BUN="$(command -v bun)"
elif [ -n "${HOME:-}" ] && [ -x "${HOME:-}/.bun/bin/bun" ]; then
BUN="${HOME:-}/.bun/bin/bun"
elif [ -x "/root/.bun/bin/bun" ]; then
BUN="/root/.bun/bin/bun"
else
printf '%s\n' '{"ok":false,"failureKind":"infra-failed","message":"bun runtime not found; set BUN_BIN or install Bun"}'
exit 127
fi
exec "$BUN" "$ROOT_DIR/scripts/agentrun-cli.ts" "$@"