From 618e5c2aa34992dc101d439353a75a9ba74a46ff Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Mon, 1 Jan 2024 13:51:20 +0100 Subject: [PATCH] add gents.sh, forgot to commit --- gents.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100755 gents.sh diff --git a/gents.sh b/gents.sh new file mode 100755 index 0000000..4d142d9 --- /dev/null +++ b/gents.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -euo pipefail + +# generate new typescript client, only install it when it is different, so we +# don't trigger frontend builds needlessly. +go run vendor/github.com/mjl-/sherpats/cmd/sherpats/main.go -bytes-to-string -slices-nullable -maps-nullable -nullable-optional -namespace api api <$1 >$2.tmp +if cmp -s $2 $2.tmp; then + rm $2.tmp +else + mv $2.tmp $2 +fi