#!/usr/bin/env bash set -e REPO_DIR="$(cd $(dirname ${BASH_SOURCE[0]} )/..; pwd )" DECODE_TYPE_CRATE_DIR="${DECODE_TYPE_CRATE_DIR?You must set this environment variable with the path to the crate containing your serialized type. E.g. \'framed-rs/test_type\'}" DECODE_TYPE_NAME="${DECODE_TYPE_NAME?You must set this environment variable with the full name of your serialized type including its module path. E.g. \'framed_test_type::Test\'}" echo "DECODE_TYPE_CRATE_DIR = '${DECODE_TYPE_CRATE_DIR}'" echo "DECODE_TYPE_NAME = '${DECODE_TYPE_NAME}'" TYPE_CRATE_NAME="$(cargo read-manifest --manifest-path "${DECODE_TYPE_CRATE_DIR}/Cargo.toml" | jq '.name' -r)" TMP_DIR="${REPO_DIR}/target/decode_typed/tmp" mkdir -p "${TMP_DIR}"; rm -f "${TMP_DIR}/"*; export FRAMED_DECODE_DYNAMIC_RS="${TMP_DIR}/dynamic_${DECODE_TYPE_NAME}.rs"; cat > "${FRAMED_DECODE_DYNAMIC_RS}" <