From 181256b716ac3ea6d60f7c0e601590a5d972d459 Mon Sep 17 00:00:00 2001 From: Josh Elkins Date: Mon, 23 Oct 2023 14:50:51 -0500 Subject: [PATCH] chore: Remove all models before copying in latest versions (#1185) --- codegen/sdk-codegen/scripts/updatemodels.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/codegen/sdk-codegen/scripts/updatemodels.sh b/codegen/sdk-codegen/scripts/updatemodels.sh index 991d5b2db67..2b566484479 100755 --- a/codegen/sdk-codegen/scripts/updatemodels.sh +++ b/codegen/sdk-codegen/scripts/updatemodels.sh @@ -33,6 +33,10 @@ fetchGitHubRepo JSON_MODEL_FILES=`find ${TEMPDIR}/aws-models |grep -e "smithy\/model\.json$"` +# Delete all current model files before copying latest models in. +# This ensures that removed models will not be included in the next release. +rm -rf $OUTPUT_DIR/* + for model in ${JSON_MODEL_FILES}; do SDKID=`cat ${model} |grep \"sdkId\": | sed 's/.*: \(.*\)/\1/g' | tr -d "\"" | tr -d "," | tr '[:upper:]' '[:lower:]' | tr " " "-"` NUM_VERSIONS=`cat "${model}" | grep -e "\"version\": \"[0-9]*-[0-9]*-[0-9]*\"" |wc -l |awk '{print $1}'`