mirror of
https://gitlab.com/veilid/veilid.git
synced 2024-12-26 15:59:24 -05:00
Merge branch 'python-schema-update-script' into 'main'
veilid-python: update_schema.sh now checks in a few places for veilid-server See merge request veilid/veilid!151
This commit is contained in:
commit
6f71c6a00a
@ -2,16 +2,27 @@
|
|||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||||
|
|
||||||
VEILID_SERVER=$SCRIPTDIR/../target/debug/veilid-server
|
# If $VEILID_SERVER is set, use that, otherwise find a valid Veilid server by looking in the usual places
|
||||||
|
if [ -z "${VEILID_SERVER}" ]; then
|
||||||
|
for VEILID_SERVER_CANDIDATE in ${SCRIPTDIR}/../target/debug/veilid-server; do
|
||||||
|
echo -n "Trying Veilid server at ${VEILID_SERVER_CANDIDATE}..."
|
||||||
|
if [ -f "${VEILID_SERVER_CANDIDATE}" ]; then
|
||||||
|
echo " found!"
|
||||||
|
VEILID_SERVER="${VEILID_SERVER_CANDIDATE}"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echo " not found."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
# Ensure executable exists
|
# If $VEILID_SERVER is still not set, or if it doesn't actually exist, bail
|
||||||
if [ ! -f "$VEILID_SERVER" ]; then
|
if [[ -z "${VEILID_SERVER}" || ! -f "${VEILID_SERVER}" ]]; then
|
||||||
echo "$VEILID_SERVER does not exist. Build with cargo build."
|
echo "No valid in-tree Veilid server was found. Go to the top level directory, run 'cargo build', then change back to this directory and run this script again."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Produce schema from veilid-server
|
# Produce schema from veilid-server
|
||||||
$VEILID_SERVER --emit-schema Request > $SCRIPTDIR/veilid/schema/Request.json
|
for SCHEMA in "Request" "RecvMessage"; do
|
||||||
$VEILID_SERVER --emit-schema RecvMessage > $SCRIPTDIR/veilid/schema/RecvMessage.json
|
echo -n "Updating ${SCHEMA}..." && ${VEILID_SERVER} --emit-schema ${SCHEMA} > $SCRIPTDIR/veilid/schema/${SCHEMA} && echo " done." || echo " error!"
|
||||||
|
done
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user