1 #!/bin/sh
2 # Source this to get the local Go toolchain that TinyGo drives, then:
3 # . ./scripts/env.sh && make build
4 #
5 # TinyGo invokes `go` to locate and compile the standard library sources, so a
6 # Go installation must be on PATH even though the relay itself is built by
7 # TinyGo.
8 9 if [ -x "$HOME/.local/goroot/bin/go" ]; then
10 GOROOT="$HOME/.local/goroot"
11 export GOROOT
12 PATH="$GOROOT/bin:$PATH"
13 export PATH
14 fi
15 16 if ! command -v go >/dev/null 2>&1; then
17 echo "scripts/env.sh: no Go toolchain found; install Go 1.25+ or place it in ~/.local/goroot" >&2
18 fi
19 if ! command -v tinygo >/dev/null 2>&1; then
20 echo "scripts/env.sh: tinygo not found on PATH" >&2
21 fi
22