|
1
|
#!/usr/bin/env bash |
|
2
|
# Development wrapper for the compiled Gemini relay broker. |
|
3
|
|
|
4
|
set -euo pipefail |
|
5
|
|
|
6
|
SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) |
|
7
|
REPO_ROOT=$(CDPATH= cd -- "$SCRIPT_DIR/../../.." && pwd) |
|
8
|
|
|
9
|
if [ -x "$REPO_ROOT/bin/gemini-relay" ]; then |
|
10
|
exec "$REPO_ROOT/bin/gemini-relay" "$@" |
|
11
|
fi |
|
12
|
|
|
13
|
if ! command -v go >/dev/null 2>&1; then |
|
14
|
printf 'gemini-relay: go is required to run the broker from the repo checkout\n' >&2 |
|
15
|
exit 1 |
|
16
|
fi |
|
17
|
|
|
18
|
exec go run "$REPO_ROOT/cmd/gemini-relay" "$@" |
|
19
|
|