github.com/lestrrat-go/jwx/v2@v2.0.21/tools/cmd/genoptions.sh (about) 1 #!/bin/bash 2 3 # Script to perform code generation. This exists to overcome 4 # the fact that go:generate doesn't really allow you to change directories 5 6 # This script is expected to be executed from the root directory of jwx 7 8 set -e 9 10 echo "👉 Generating options..." 11 12 DIR=tools/cmd/genoptions 13 pushd "$DIR" > /dev/null 14 GOWORK=off go build -o .genoptions main.go 15 popd > /dev/null 16 17 EXE="$DIR/.genoptions" 18 19 for dir in jwe jwk jws jwt; do 20 echo " ⌛ Processing $dir/options.yaml" 21 "$EXE" -objects="$dir/options.yaml" 22 done 23 echo "✔ done!" 24 25 rm "$EXE"