2023-09-28 10:13:41 +02:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
script="$(realpath "${BASH_SOURCE[-1]}")"
|
|
|
|
path="$(dirname "$script")"
|
|
|
|
|
|
|
|
cd $path
|
|
|
|
|
|
|
|
wget -O spaceapi-schema.json https://raw.githubusercontent.com/SpaceApi/schema/master/14.json
|
|
|
|
go install github.com/a-h/generate/cmd/schema-generate@latest
|
|
|
|
mkdir -p pkg/spaceapi
|
2023-10-19 22:56:59 +02:00
|
|
|
/go/bin/schema-generate -o pkg/spaceapi/spaceapi.go -p spaceapi spaceapi-schema.json
|
2023-09-28 10:13:41 +02:00
|
|
|
rm spaceapi-schema.json
|
|
|
|
|
|
|
|
# TODO: Do it inline
|
|
|
|
# https://github.com/a-h/generate/blob/master/cmd/schema-generate/main.go
|