17 lines
452 B
Bash
Executable File
17 lines
452 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -e
|
|
|
|
# cargo install serde-generate
|
|
if command -v serdegen &> /dev/null
|
|
then
|
|
serdegen ./pkg/gossip/schema.yaml \
|
|
--language=Go \
|
|
--with-runtimes=Bincode \
|
|
--module-name=gossip \
|
|
--serde-package-name=gossip \
|
|
> ./pkg/gossip/schema.go
|
|
sed -i'.bak' '1s/^/\/\/ Code generated by "serde-generate"; DO NOT EDIT.\n\n/' ./pkg/gossip/schema.go
|
|
rm -f ./pkg/gossip/schema.go.bak
|
|
go fmt ./pkg/gossip/schema.go
|
|
fi
|