spawn/hetzner/opencode.sh
A 5a1929f6d4
fix: harden credential file permissions and curl SSL error visibility (#1803)
Fixes #1801 - chmod 600 on gh hosts.yml after token login
Fixes #1798 - remove 2>&1 from bun install curl across agent scripts

Agent: security-auditor

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-23 08:35:18 -05:00

19 lines
656 B
Bash
Executable file

#!/bin/bash
set -eo pipefail
_ensure_bun() {
if command -v bun &>/dev/null; then return 0; fi
curl -fsSL --show-error https://bun.sh/install | bash >/dev/null
export PATH="$HOME/.bun/bin:$PATH"
}
_ensure_bun
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" 2>/dev/null && pwd)"
if [[ -n "$SCRIPT_DIR" && -f "$SCRIPT_DIR/../cli/src/hetzner/main.ts" ]]; then
exec bun run "$SCRIPT_DIR/../cli/src/hetzner/main.ts" opencode "$@"
fi
HETZNER_JS=$(mktemp)
trap 'rm -f "$HETZNER_JS"' EXIT
curl -fsSL "https://github.com/OpenRouterTeam/spawn/releases/download/hetzner-latest/hetzner.js" -o "$HETZNER_JS"
exec bun run "$HETZNER_JS" opencode "$@"